import { OVERVIEW_PERIODS, type OverviewPeriod } from "@/shared/overview"; import { getOverview } from "../service"; import { OverviewChart } from "./overview-chart"; type Search = Record; const periodOf = (x: unknown): OverviewPeriod => OVERVIEW_PERIODS.includes(x as OverviewPeriod) ? (x as OverviewPeriod) : "month"; /** Dashboard ana grafiği (sunucu): ?periyot=week|month|half|year&gorunum=kumulatif|donemsel. */ export async function OverviewCard({ userId, householdId, searchParams, }: { userId: string; householdId: string; searchParams: Promise; }) { const q = await searchParams; const data = await getOverview(userId, householdId, periodOf(q.periyot)); if (!data) return null; return ; }