import Link from 'next/link'; import { AdminShell } from '@/components/admin/AdminShell'; import { EDITABLE_SECTIONS } from '@/lib/content/sections'; import { sectionStatus } from '@/lib/db/store'; import { passwordConfigured } from '@/lib/auth/session'; export const dynamic = 'force-dynamic'; function timeAgo(ts: number): string { const s = Math.floor((Date.now() - ts) / 1000); if (s < 60) return 'just now'; const m = Math.floor(s / 60); if (m < 60) return `${m}m ago`; const h = Math.floor(m / 60); if (h < 24) return `${h}h ago`; return `${Math.floor(h / 24)}d ago`; } export default function AdminDashboard() { const status = sectionStatus(); const usingDefaultPassword = !process.env.ADMIN_PASSWORD && passwordConfigured(); const edited = Object.keys(status).length; return (

Dashboard

Edit every section of the site. {edited > 0 ? `${edited} section${edited > 1 ? 's' : ''} customized.` : 'All sections are at their defaults.'}

{usingDefaultPassword && (
Heads up: no ADMIN_PASSWORD is set, so the dev default (admin) is in use. Set one in your environment before going live.
)}
{EDITABLE_SECTIONS.map((s) => { const edited = status[s.key]; return (

{s.label.en} {s.label.fa}

{edited ? ( edited · {timeAgo(edited)} ) : ( default )}

{s.desc.en}

); })}

Journal articles مقالات

bodies →

Edit the full bilingual body of each blog post (lead + content blocks).

); }