251205:0000 Just start debug backend/frontend
This commit is contained in:
@@ -1,67 +1,39 @@
|
||||
// File: app/(dashboard)/dashboard/page.tsx
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { StatsCards } from "@/components/dashboard/stats-cards";
|
||||
import { RecentActivity } from "@/components/dashboard/recent-activity";
|
||||
import { PendingTasks } from "@/components/dashboard/pending-tasks";
|
||||
import { QuickActions } from "@/components/dashboard/quick-actions";
|
||||
import { dashboardApi } from "@/lib/api/dashboard";
|
||||
|
||||
export default async function DashboardPage() {
|
||||
// Fetch data in parallel
|
||||
const [stats, activities, tasks] = await Promise.all([
|
||||
dashboardApi.getStats(),
|
||||
dashboardApi.getRecentActivity(),
|
||||
dashboardApi.getPendingTasks(),
|
||||
]);
|
||||
|
||||
export default function DashboardPage() {
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
{/* Header Section */}
|
||||
<div className="flex items-center">
|
||||
<h1 className="text-lg font-semibold md:text-2xl">Dashboard</h1>
|
||||
</div>
|
||||
|
||||
{/* KPI Cards Section */}
|
||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">
|
||||
เอกสารรออนุมัติ
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">12</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
+2 จากเมื่อวาน
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">
|
||||
RFAs ที่กำลังดำเนินการ
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">24</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
อยู่ในขั้นตอนตรวจสอบ
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Add more KPI cards as needed */}
|
||||
<div className="space-y-8">
|
||||
<div className="flex flex-col md:flex-row justify-between items-start md:items-center gap-4">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-tight">Dashboard</h1>
|
||||
<p className="text-muted-foreground mt-1">
|
||||
Welcome back! Here's an overview of your project status.
|
||||
</p>
|
||||
</div>
|
||||
<QuickActions />
|
||||
</div>
|
||||
|
||||
{/* Main Content Section (My Tasks + Recent Activity) */}
|
||||
<div className="grid gap-4 md:gap-8 lg:grid-cols-3">
|
||||
|
||||
{/* Content Area หลัก (My Tasks) กินพื้นที่ 2 ส่วน */}
|
||||
<Card className="lg:col-span-2">
|
||||
<CardHeader>
|
||||
<CardTitle>งานของฉัน (My Tasks)</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="h-[300px] w-full rounded bg-muted/20 flex items-center justify-center text-muted-foreground">
|
||||
Table Placeholder (My Tasks)
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<StatsCards stats={stats} />
|
||||
|
||||
{/* Recent Activity กินพื้นที่ 1 ส่วนด้านขวา */}
|
||||
<RecentActivity />
|
||||
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||
<div className="lg:col-span-2">
|
||||
<RecentActivity activities={activities} />
|
||||
</div>
|
||||
<div className="lg:col-span-1">
|
||||
<PendingTasks tasks={tasks} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user