import { Box } from './Box'; import { Card } from './Card'; import { Text } from './Text'; export interface GoalCardProps { title: string; current?: number; target?: number; unit?: string; icon: string; goalLabel?: string; currentValue?: number; maxValue?: number; } export const GoalCard = ({ title, current, target, unit, icon, goalLabel, currentValue, maxValue }: GoalCardProps) => { const finalCurrent = currentValue ?? current ?? 0; const finalTarget = maxValue ?? target ?? 100; const finalUnit = goalLabel ?? unit ?? ''; const percentage = Math.min(Math.max((finalCurrent / finalTarget) * 100, 0), 100); return ( {icon} {title} {finalUnit} Progress {Math.round(percentage)}% {finalCurrent} / {finalTarget} {finalUnit} ); };