import type { Metadata } from "next"; import { Suspense } from "react"; import { PageHeader } from "@/components/page-header"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { SummaryCardsSkeleton } from "@/features/dashboard/components/summary-cards-skeleton"; import { tr } from "@/i18n/tr"; import { requireActiveHousehold } from "@/lib/dal"; import { cn } from "@/lib/utils"; import { formatMoney } from "@/shared/format"; export const metadata: Metadata = { title: tr.dashboard.title }; type SummaryCard = { key: keyof typeof tr.dashboard.cards; tone?: string; amountMinor: number | null; }; /** FAZ 14: gerçek özet verisi (gelir, gider, bakiye, kart borcu, net varlık). */ async function getSummary(): Promise { return [ { key: "monthIncome", tone: "text-income", amountMinor: null }, { key: "monthExpense", tone: "text-expense", amountMinor: null }, { key: "monthRemaining", tone: "text-budget", amountMinor: null }, { key: "totalBalance", amountMinor: null }, { key: "cardDebt", tone: "text-expense", amountMinor: null }, { key: "netWorth", amountMinor: null }, ]; } async function SummaryCards() { const cards = await getSummary(); return (
{cards.map((c) => ( {tr.dashboard.cards[c.key]} {c.amountMinor === null ? "—" : formatMoney(c.amountMinor)} {c.amountMinor === null ? ( {tr.dashboard.noData} ) : null} ))}
); } export default async function DashboardPage() { const { user, household } = await requireActiveHousehold("viewer"); return ( <> }> ); }