refactor: remove counter property from CardReport and dashboard data for simplification
This commit is contained in:
parent
fe38a63f1c
commit
00bb1a46dc
@ -10,11 +10,10 @@ type CardReportProperty = {
|
|||||||
properties: React.JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>,
|
properties: React.JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>,
|
||||||
) => JSX.Element
|
) => JSX.Element
|
||||||
url?: string
|
url?: string
|
||||||
counter?: number[]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CardReport = (properties: CardReportProperty) => {
|
export const CardReport = (properties: CardReportProperty) => {
|
||||||
const { title, amount, icon: Icon, counter, currency } = properties
|
const { title, amount, icon: Icon, currency } = properties
|
||||||
return (
|
return (
|
||||||
<div className="rounded-xl bg-white px-4 py-6 shadow-sm">
|
<div className="rounded-xl bg-white px-4 py-6 shadow-sm">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
@ -32,11 +31,6 @@ export const CardReport = (properties: CardReportProperty) => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{counter?.length && (
|
|
||||||
<div className="flex items-center pt-2">
|
|
||||||
Pribadi: {counter[0]} | Perusahaan: {counter[1]}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,12 +17,10 @@ export const HISTORY = [
|
|||||||
title: 'Total Content Biasa',
|
title: 'Total Content Biasa',
|
||||||
amount: 2890,
|
amount: 2890,
|
||||||
icon: GraphIcon,
|
icon: GraphIcon,
|
||||||
counter: [2190, 700],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Total Content Premium',
|
title: 'Total Content Premium',
|
||||||
amount: 274,
|
amount: 274,
|
||||||
icon: DoctorIcon,
|
icon: DoctorIcon,
|
||||||
counter: [211, 54],
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@ -34,13 +34,12 @@ export const DashboardPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-5 grid grid-cols-1 gap-6 sm:grid-cols-3 sm:grid-rows-2">
|
<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) => (
|
{HISTORY.map(({ title, amount, icon }, index) => (
|
||||||
<CardReport
|
<CardReport
|
||||||
key={index}
|
key={index}
|
||||||
title={title}
|
title={title}
|
||||||
amount={amount}
|
amount={amount}
|
||||||
icon={icon}
|
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">
|
<div className="max-h-[300px] sm:col-span-2 sm:col-start-2 sm:row-span-2 sm:row-start-1">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user