feat: update dashboard components and add new icons for improved reporting

This commit is contained in:
fredy.siswanto 2025-02-23 23:17:06 +07:00
parent 7334e07537
commit 00bb4f99cb
5 changed files with 130 additions and 3 deletions

View File

@ -0,0 +1,21 @@
import type { JSX, SVGProps } from 'react'
export const GraphIcon = (
properties: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) => {
return (
<svg
width={29}
height={28}
viewBox="0 0 29 28"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
{...properties}
>
<path
d="M19.383 2.499H9.471c-4.306 0-6.872 2.496-6.872 6.682v9.625c0 4.197 2.566 6.693 6.872 6.693h9.9c4.306 0 6.873-2.495 6.873-6.681V9.18c.012-4.186-2.555-6.682-6.86-6.682zM9.258 21.071c0 .472-.402.863-.887.863s-.887-.391-.887-.863v-2.38c0-.471.402-.863.887-.863s.887.392.887.863v2.38zm6.056 0c0 .472-.402.863-.887.863s-.887-.391-.887-.863V16.3c0-.471.402-.862.887-.862s.887.39.887.862v4.773zm6.057 0c0 .472-.403.863-.888.863s-.887-.391-.887-.863v-7.153c0-.471.402-.862.887-.862s.888.391.888.863v7.152zm0-10.787c0 .472-.403.863-.888.863s-.887-.391-.887-.863V9.17a23.266 23.266 0 01-11.012 6.164c-.071.023-.142.023-.213.023a.891.891 0 01-.864-.655.859.859 0 01.651-1.047 21.515 21.515 0 0010.35-5.876H17.03c-.485 0-.887-.391-.887-.863 0-.471.402-.862.887-.862h3.466c.048 0 .083.023.13.023.06.011.119.011.178.034.059.023.106.058.165.092.036.023.071.035.107.058.012.011.012.023.024.023.047.046.082.092.118.138.035.046.07.08.083.126.023.046.023.092.035.15.012.057.036.115.036.184 0 .011.011.023.011.034v3.37h-.011z"
fill="currentColor"
/>
</svg>
)
}

View File

@ -0,0 +1,21 @@
import type { JSX, SVGProps } from 'react'
export const UserDoctorIcon = (
properties: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) => {
return (
<svg
width={25}
height={28}
viewBox="0 0 25 28"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
{...properties}
>
<path
d="M12.714 14.364a6.821 6.821 0 006.822-6.822A6.821 6.821 0 0012.714.72a6.822 6.822 0 00-6.822 6.822 6.822 6.822 0 006.822 6.822zM6.32 23.318c0 .708.57 1.279 1.279 1.279s1.279-.57 1.279-1.28c0-.708-.57-1.278-1.28-1.278-.708 0-1.278.57-1.278 1.279zM17.83 16.1v2.612a4.27 4.27 0 013.41 4.178v2.223a.855.855 0 01-.687.837l-1.716.34a.424.424 0 01-.501-.335l-.165-.837a.422.422 0 01.336-.5l1.028-.209v-1.519c0-3.347-5.116-3.47-5.116.102v1.423l1.028.207c.23.048.379.272.336.502l-.165.836a.432.432 0 01-.501.336l-1.663-.224a.852.852 0 01-.736-.847V22.89a4.274 4.274 0 013.412-4.178v-2.41c-.118.038-.235.06-.352.102a9.244 9.244 0 01-3.06.522c-1.07 0-2.1-.186-3.059-.522a5.889 5.889 0 00-1.204-.277v4.349a2.974 2.974 0 012.132 2.846 2.987 2.987 0 01-2.985 2.985 2.987 2.987 0 01-2.985-2.985c0-1.348.901-2.478 2.132-2.846v-4.285c-3.39.57-5.974 3.49-5.974 7.04v2.388a2.39 2.39 0 002.387 2.388h19.102a2.39 2.39 0 002.388-2.388v-2.388c0-3.837-3.028-6.944-6.822-7.13z"
fill="currentColor"
/>
</svg>
)
}

View File

@ -0,0 +1,60 @@
import { Link } from 'react-router'
import { GraphIcon } from '~/components/icons/graph'
interface CardReportProperty {
title: string
amound?: number
url?: string
type?: 'history' | 'report'
counter?: number[]
}
export const CardReport = (properties: CardReportProperty) => {
const { title, amound, url } = properties
return url ? (
<div className="flex h-26 max-w-[360px] min-w-[300px] items-center justify-between rounded bg-white px-4 py-6 shadow-sm">
<GraphIcon
className="ml-2 rounded-xl bg-[#2E2F7C] p-2 text-white"
height={48}
width={48}
/>
<Link
to={url}
className="text-[#2E2F7C]"
>
<div className="text-[#2E2F7C]">
<h2 className="text-medium font-medium text-[#363636]">{title}</h2>
<p className="text-2xl font-bold">
<span>Rp.</span>
{amound}
</p>
</div>
</Link>
</div>
) : (
<div className="flex h-26 max-w-[360px] min-w-[300px] items-center justify-between gap-4 rounded bg-white px-4 py-6 shadow-sm">
<GraphIcon
className="ml-2 rounded-xl bg-[#2E2F7C] p-2 text-white"
height={48}
width={48}
/>
<div className="text-[#2E2F7C]">
<h2 className="text-medium font-medium text-[#363636]">{title}</h2>
<p className="text-2xl font-bold">
<span>Rp.</span>
{amound}
</p>
{/* <div className="flex flex-row gap-4 text-[#363636]">
<p>
<span>Pribadi : </span> {0}
</p>
<p>
<span>Perusahaan : </span> {0}
</p>
</div> */}
</div>
</div>
)
}

View File

@ -9,12 +9,12 @@ export const HISTORY = [
title: 'Total Kunjungan',
total: 1_000_000,
icon: 'money',
report: [2190, 700],
counter: [2190, 700],
},
{
title: 'Total User Memesan',
total: 274,
icon: 'money',
report: [211, 54],
counter: [211, 54],
},
]

View File

@ -1,7 +1,32 @@
import { CardReport } from '~/components/ui/card-report'
import { REPORT, HISTORY } from './data'
export const DashboardPage = () => {
return (
<div className="relative">
<h1>test DashboardPage</h1>
<div>
<h1>Dashboard</h1>
<div>tanggal</div>
</div>
<div className="flex flex-row gap-4">
{REPORT.map((report) => (
<CardReport
key={report.title}
title={report.title}
amound={report.amound}
></CardReport>
))}
</div>
<div className="mt-5 flex flex-col gap-4">
{HISTORY.map((report) => (
<CardReport
key={report.title}
title={report.title}
counter={report.counter}
></CardReport>
))}
</div>
</div>
)
}