UNPKG

@sanity/assist

Version:

You create the instructions; Sanity AI Assist does the rest.

7 lines (5 loc) 222 B
import {useEditState} from 'sanity' export function useDocumentState<T>(id: string, docType: string): T | undefined { const state = useEditState(id, docType) return (state.draft || state.published) as T | undefined }