import { addTask, removeTask, setStatus } from './actions'; import { dbHealth } from '@/lib/db'; import { buildInfo } from '@/lib/build-info'; import { listTasks, STATUSES, type Status } from '@/lib/tasks'; // Always render per request: the board is live data, and the footer shows the running build. export const dynamic = 'force-dynamic'; const TITLES: Record = { todo: 'To do', doing: 'In progress', done: 'Done' }; const bootedAt = new Date().toISOString(); export default async function Home() { const [tasks, health] = await Promise.all([listTasks().catch(() => null), dbHealth()]); return (

Taskboard

DB {health.status}
{tasks === null ? (

Could not load tasks. Check the database connection.

) : (
{STATUSES.map((s) => (

{TITLES[s]} {tasks.filter((t) => t.status === s).length}

{tasks .filter((t) => t.status === s) .map((t) => (
{t.title} {t.assignee && @{t.assignee}}
{STATUSES.filter((x) => x !== s).map((x) => (
))}
))}
))}
)}
); }