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) 357 B
import {useContext} from 'react' import {WorkspacesContext} from 'sanity/_singletons' import {type WorkspaceSummary} from '../../config' /** @internal */ export function useWorkspaces(): WorkspaceSummary[] { const workspaces = useContext(WorkspacesContext) if (!workspaces) throw new Error('Could not find `workspaces` context') return workspaces }