import { redirect } from "next/navigation"; import { getActiveContext } from "@/lib/appwrite/active-context"; import { getDashboardData } from "@/lib/appwrite/dashboard-queries"; import { CustomerGrowth } from "./components/customer-growth"; import { IncomeChart } from "./components/income-chart"; import { Metrics } from "./components/metrics"; import { QuickActions } from "./components/quick-actions"; import { RecentTransactions } from "./components/recent-transactions"; import { TopCustomers } from "./components/top-customers"; export default async function DashboardPage() { const ctx = await getActiveContext(); if (!ctx) redirect("/onboarding"); const data = await getDashboardData(ctx.tenantId, ctx.user.id); const firstName = ctx.user.name?.split(" ")[0] ?? ""; const companyName = ctx.settings?.companyName ?? "Çalışma alanı"; return (

{companyName}

{firstName ? `Hoş geldiniz, ${firstName}` : "Genel bakış"}

İşletmenizin temel metriklerini ve son hareketleri buradan takip edin.

); }