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>,
|
||||
) => JSX.Element
|
||||
url?: string
|
||||
counter?: number[]
|
||||
}
|
||||
|
||||
export const CardReport = (properties: CardReportProperty) => {
|
||||
const { title, amount, icon: Icon, counter, currency } = properties
|
||||
const { title, amount, icon: Icon, currency } = properties
|
||||
return (
|
||||
<div className="rounded-xl bg-white px-4 py-6 shadow-sm">
|
||||
<div className="flex items-center">
|
||||
@ -32,11 +31,6 @@ export const CardReport = (properties: CardReportProperty) => {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{counter?.length && (
|
||||
<div className="flex items-center pt-2">
|
||||
Pribadi: {counter[0]} | Perusahaan: {counter[1]}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -17,12 +17,10 @@ export const HISTORY = [
|
||||
title: 'Total Content Biasa',
|
||||
amount: 2890,
|
||||
icon: GraphIcon,
|
||||
counter: [2190, 700],
|
||||
},
|
||||
{
|
||||
title: 'Total Content Premium',
|
||||
amount: 274,
|
||||
icon: DoctorIcon,
|
||||
counter: [211, 54],
|
||||
},
|
||||
]
|
||||
|
||||
@ -34,13 +34,12 @@ export const DashboardPage = () => {
|
||||
</div>
|
||||
|
||||
<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
|
||||
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">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user