From ff74a98e24dea9d401a60530e67461a85b955e1e Mon Sep 17 00:00:00 2001 From: Tania Gutierrez Date: Wed, 13 Mar 2024 21:50:32 -0400 Subject: [PATCH] feat: Allow usageCard button to be replaced for another one --- app/components/usage-card.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/components/usage-card.tsx b/app/components/usage-card.tsx index be14ec9..a6bd683 100644 --- a/app/components/usage-card.tsx +++ b/app/components/usage-card.tsx @@ -6,10 +6,11 @@ interface UsageCardProps { label: string, monthlyUsage: number, // Asumming that the minimium is 1GB currentUsage: number, - icon: React.ReactNode + icon: React.ReactNode, + button?: React.ReactNode; } -export const UsageCard = ({ label, monthlyUsage, currentUsage, icon }: UsageCardProps) => { +export const UsageCard = ({ label, monthlyUsage, currentUsage, icon, button }: UsageCardProps) => { return (
@@ -20,10 +21,14 @@ export const UsageCard = ({ label, monthlyUsage, currentUsage, icon }: UsageCard
Montly {label.toLocaleLowerCase()} limit is {monthlyUsage} GB
- + {!button ? ( + + ) : ( + button + )}
@@ -32,4 +37,4 @@ export const UsageCard = ({ label, monthlyUsage, currentUsage, icon }: UsageCard
) -} \ No newline at end of file +}