/* The site's pages of sections (Pages → Page management): GET /site-pages/:id for one page's title, intro and sections, GET /site-pages for every page's section headings by the page's path (the header's dropdowns, the footer, the side nav). */ import { useRecord, type Resource } from './useRecord.ts' import type { ContentBlock } from './useContent.ts' export type SitePageSection = { anchor: string title: string blurb?: string | null accent?: 'teal' | 'deep' | 'green' | 'amber' | null preset?: string | null scope_id?: string | null event_type?: string | null view?: string | null /** A people_directory preset's tags (Data → People tags), a tab each, in order. */ tag_ids: string[] /** Organization cards: the kinds listed ('partner', 'ministry' or both, comma separated). */ org_kinds?: string | null /** Organization cards: a hand-picked list, in order, shown instead. */ org_ids: string[] blocks: ContentBlock[] } export const useSitePage = (id: string): Resource<{ id: string; title: string; description: string | null; sections: SitePageSection[] }> => useRecord(`/site-pages/${id}`, 'page') export const useSitePageHeadings = (): Resource>> => useRecord('/site-pages', 'pages')