2025-02-23 23:17:06 +07:00
|
|
|
import { CardReport } from '~/components/ui/card-report'
|
2025-02-26 00:35:53 +07:00
|
|
|
import {
|
|
|
|
|
ChartSubscription,
|
|
|
|
|
UiChartBar,
|
|
|
|
|
UiChartPie,
|
|
|
|
|
} from '~/components/ui/chart'
|
2025-02-23 23:17:06 +07:00
|
|
|
|
2025-02-24 09:31:48 +08:00
|
|
|
import { HISTORY, REPORT } from './data'
|
2025-02-23 21:13:31 +07:00
|
|
|
export const DashboardPage = () => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="relative">
|
2025-02-26 00:35:53 +07:00
|
|
|
<section className="mb-5 flex items-center justify-between">
|
|
|
|
|
<h1 className="text-xl font-bold">Dashboard</h1>
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<span>Tanggal:</span>
|
|
|
|
|
<input
|
|
|
|
|
type="date"
|
|
|
|
|
className="rounded border p-2"
|
|
|
|
|
/>
|
|
|
|
|
<input
|
|
|
|
|
type="date"
|
|
|
|
|
className="rounded border p-2"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2025-02-25 22:52:26 +07:00
|
|
|
<div className="mt-5 grid grid-cols-1 grid-rows-1 gap-6 sm:grid-cols-3">
|
|
|
|
|
{REPORT.map(({ title, amount, icon }, index) => (
|
|
|
|
|
<CardReport
|
|
|
|
|
key={index}
|
|
|
|
|
title={title}
|
|
|
|
|
amount={amount}
|
|
|
|
|
icon={icon}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
2025-02-23 23:17:06 +07:00
|
|
|
|
2025-02-25 22:52:26 +07:00
|
|
|
<div className="mt-5 grid grid-cols-1 gap-6 sm:grid-cols-3 sm:grid-rows-2">
|
|
|
|
|
{HISTORY.map(({ title, amount, icon, counter }, index) => (
|
|
|
|
|
<CardReport
|
|
|
|
|
key={index}
|
|
|
|
|
title={title}
|
|
|
|
|
amount={amount}
|
|
|
|
|
icon={icon}
|
|
|
|
|
counter={counter}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
<div className="max-h-[300px] sm:col-span-2 sm:col-start-2 sm:row-span-2 sm:row-start-1">
|
2025-02-26 00:35:53 +07:00
|
|
|
<UiChartPie />
|
2025-02-24 00:54:00 +07:00
|
|
|
</div>
|
2025-02-25 22:52:26 +07:00
|
|
|
</div>
|
2025-02-24 00:54:00 +07:00
|
|
|
|
2025-02-26 00:35:53 +07:00
|
|
|
<div className="mt-5 grid max-h-[280px] grid-cols-1 grid-rows-2 gap-6 sm:grid-cols-5 sm:grid-rows-1">
|
2025-02-25 22:52:26 +07:00
|
|
|
<div className="sm:col-span-3">
|
|
|
|
|
<div className="h-30 w-full">
|
|
|
|
|
<div className="shadow-sm">
|
2025-02-26 00:35:53 +07:00
|
|
|
<UiChartBar />
|
2025-02-25 22:52:26 +07:00
|
|
|
</div>
|
2025-02-24 00:54:00 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-25 22:52:26 +07:00
|
|
|
<div className="sm:col-span-2 sm:col-start-4">
|
|
|
|
|
<div className="h-30 w-full">
|
|
|
|
|
<div className="shadow-sm">
|
2025-02-26 00:35:53 +07:00
|
|
|
<ChartSubscription />
|
2025-02-25 22:52:26 +07:00
|
|
|
</div>
|
2025-02-24 00:54:00 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-23 23:17:06 +07:00
|
|
|
</div>
|
2025-02-23 21:13:31 +07:00
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|