From 00bb4f99cbd9d7295c85f8cb54b8b4c08f0284c8 Mon Sep 17 00:00:00 2001 From: "fredy.siswanto" Date: Sun, 23 Feb 2025 23:17:06 +0700 Subject: [PATCH] feat: update dashboard components and add new icons for improved reporting --- app/components/icons/graph.tsx | 21 ++++++++++ app/components/icons/user-doctor.tsx | 21 ++++++++++ app/components/ui/card-report.tsx | 60 ++++++++++++++++++++++++++++ app/pages/dashboard/data.ts | 4 +- app/pages/dashboard/index.tsx | 27 ++++++++++++- 5 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 app/components/icons/graph.tsx create mode 100644 app/components/icons/user-doctor.tsx create mode 100644 app/components/ui/card-report.tsx diff --git a/app/components/icons/graph.tsx b/app/components/icons/graph.tsx new file mode 100644 index 0000000..558b4a9 --- /dev/null +++ b/app/components/icons/graph.tsx @@ -0,0 +1,21 @@ +import type { JSX, SVGProps } from 'react' + +export const GraphIcon = ( + properties: JSX.IntrinsicAttributes & SVGProps, +) => { + return ( + + + + ) +} diff --git a/app/components/icons/user-doctor.tsx b/app/components/icons/user-doctor.tsx new file mode 100644 index 0000000..f776ab6 --- /dev/null +++ b/app/components/icons/user-doctor.tsx @@ -0,0 +1,21 @@ +import type { JSX, SVGProps } from 'react' + +export const UserDoctorIcon = ( + properties: JSX.IntrinsicAttributes & SVGProps, +) => { + return ( + + + + ) +} diff --git a/app/components/ui/card-report.tsx b/app/components/ui/card-report.tsx new file mode 100644 index 0000000..4e56021 --- /dev/null +++ b/app/components/ui/card-report.tsx @@ -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 ? ( +
+ + +
+

{title}

+

+ Rp. + {amound} +

+
+ +
+ ) : ( +
+ +
+

{title}

+

+ Rp. + {amound} +

+ + {/*
+

+ Pribadi : {0} +

+

+ Perusahaan : {0} +

+
*/} +
+
+ ) +} diff --git a/app/pages/dashboard/data.ts b/app/pages/dashboard/data.ts index a4fa3ec..20cc41e 100644 --- a/app/pages/dashboard/data.ts +++ b/app/pages/dashboard/data.ts @@ -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], }, ] diff --git a/app/pages/dashboard/index.tsx b/app/pages/dashboard/index.tsx index 6413292..fe0d926 100644 --- a/app/pages/dashboard/index.tsx +++ b/app/pages/dashboard/index.tsx @@ -1,7 +1,32 @@ +import { CardReport } from '~/components/ui/card-report' + +import { REPORT, HISTORY } from './data' export const DashboardPage = () => { return (
-

test DashboardPage

+
+

Dashboard

+
tanggal
+
+ +
+ {REPORT.map((report) => ( + + ))} +
+
+ {HISTORY.map((report) => ( + + ))} +
) }