UNPKG

sanity

Version:

Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches

12 lines (9 loc) 358 B
import {useContext} from 'react' import {type WorkspaceSummary} from '../../config' import {WorkspacesContext} from './WorkspacesContext' /** @internal */ export function useWorkspaces(): WorkspaceSummary[] { const workspaces = useContext(WorkspacesContext) if (!workspaces) throw new Error('Could not find `workspaces` context') return workspaces }