mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
12 lines
390 B
TypeScript
12 lines
390 B
TypeScript
|
import { useContext } from "react";
|
||
|
// types
|
||
|
import { IWorkspaceViewContext, WorkspaceIssueViewContext } from "contexts/workspace-view-context";
|
||
|
|
||
|
export const useWorkspaceView = (): IWorkspaceViewContext => {
|
||
|
const context = useContext(WorkspaceIssueViewContext);
|
||
|
|
||
|
if (!context) throw new Error("useWorkspaceView must be used within a WorkspaceIssueViewContext");
|
||
|
|
||
|
return context;
|
||
|
};
|