TypeScript 61.9%
HTML 37.2%
SQL 0.7%
1import type { Metadata } from 'next';2import { requireUser } from '@/lib/auth/session';3import { PageHeader } from '@/components/account/page-header';4import { Card, CardHeader } from '@/components/ui/primitives';5import { PrefsForm } from './prefs-form';67export const metadata: Metadata = { title: 'Notification settings', robots: { index: false } };89export default async function NotificationSettingsPage() {10 const u = await requireUser('/account/notifications');11 const p = (u.preferences ?? {}) as Record<string, unknown>;12 return (13 <>14 <PageHeader title="Notifications" description="Choose what reaches your inbox and your e-mail. In-app notifications are always kept in your inbox." />15 <Card>16 <CardHeader title="E-mail preferences" subtitle={`Sent to ${u.email}`} />17 <div className="p-4">18 <PrefsForm prefs={{ emailAlerts: p.emailAlerts !== false, newLoginEmails: p.newLoginEmails !== false, digest: (p.digest as string) ?? 'weekly', digestWeekday: Number(p.digestWeekday ?? 1), quietStart: (p.quietStart as number | null) ?? null, quietEnd: (p.quietEnd as number | null) ?? null, marketMoves: p.marketMoves === true }} />19 </div>20 </Card>21 </>22 );23}24