import { useCallback, useState } from 'react' import { useNavigate } from 'react-router-dom' import { Loading, ErrorState } from '../../../components/PageState.jsx' import { useAsync } from '../../../lib/useAsync.js' import { shortDate } from '../../../lib/format.js' import { api } from '../../../api/client.js' // List of CMS pages. Create/edit open the full-page block builder; the builder // owns save/delete/publish so this view is read-only navigation. export default function PagesAdmin() { const navigate = useNavigate() const [tick] = useState(0) const { loading, error, data } = useAsync(() => api.admin.listPages(), [tick]) const pages = data || [] const openNew = useCallback(() => navigate('/admin/pages/new'), [navigate]) return (

Compose pages from blocks. A published page is live at /its-slug.

{loading && } {error && } {!loading && !error && (
{pages.length === 0 && ( )} {pages.map((p) => ( ))}
Title Slug Status Updated
No pages yet — create your first one.
{p.title} {p.protected && ( 🔒 )} /{p.slug} {p.status === 'published' ? 'Published' : 'Draft'} {shortDate(p.updatedAt)} {p.status === 'published' && ( View )} navigate(`/admin/pages/${p.id}`)}> Edit
)}
) }