import type { Metadata } from 'next'; import Link from 'next/link'; import { requireUser } from '@/lib/auth/session'; import { listNotifications } from '@/lib/account/queries'; import { clearNotificationsAction, markReadAction } from '@/lib/account/actions'; import { PageHeader, btnSecondary, btnGhost } from '@/components/account/page-header'; import { Card, EmptyState, Badge } from '@/components/ui/primitives'; import { fmtRelative } from '@/lib/format'; export const metadata: Metadata = { title: 'Inbox', robots: { index: false } }; const TONE: Record = { alert: 'alert', security: 'loss' as never, system: 'neutral', digest: 'index', target_hit: 'gain', radar: 'rarity' }; export default async function InboxPage() { const u = await requireUser('/notifications'); const rows = await listNotifications(u.id, 100); const unread = rows.filter((r) => !r.readAt).length; return ( <>
} /> {rows.length === 0 ? ( Create an alert} /> ) : (
    {rows.map((n) => (
  • {n.kind.replace(/_/g, ' ')}

    {n.href ? {n.title} : n.title}

    {fmtRelative(n.createdAt)}
    {n.body ?

    {n.body}

    : null}
    {!n.readAt ? (
    ) : null}
  • ))}
)}
); }