import DOMPurify from 'dompurify' import PublicLayout from '../../components/PublicLayout.jsx' import PageHeader from '../../components/PageHeader.jsx' import { Loading, ErrorState, EmptyState } from '../../components/PageState.jsx' import { useAsync } from '../../lib/useAsync.js' import { longDate } from '../../lib/format.js' import { api } from '../../api/client.js' export default function FiveOnFriday() { const { loading, error, data } = useAsync(() => api.posts('five-on-friday')) const issues = data || [] return (
{loading && } {error && } {!loading && !error && issues.length === 0 && ( No Five on Friday posts yet — the first one is coming soon. )} {issues.map((it) => (
Five on Friday {longDate(it.published_at || it.created_at)}

{it.title}

{it.body ? (
) : ( it.excerpt &&

{it.excerpt}

)}
))}
) }