import { cn } from '@/lib/utils'; import { Plus, ChevronRight } from 'lucide-react'; import { useState } from 'react'; import ComponentTitle from '@/components/ui/ComponentTitle'; import type { Milestone } from '@/types/domain'; interface StatsBoxProps { stats: { totalShares: number; }; unit?: string; milestones?: Milestone[]; selectedMilestoneIndex?: number; onMilestoneSelect?: (index: number) => void; className?: string; onAddPurchase?: () => void; onAddMilestone?: () => void; } export default function StatsBox({ stats, unit = 'units', milestones = [], selectedMilestoneIndex = 0, onMilestoneSelect, className, onAddPurchase, onAddMilestone, }: StatsBoxProps) { const [isDropdownOpen, setIsDropdownOpen] = useState(false); const handleCycleMilestone = () => { if (milestones.length === 0 || !onMilestoneSelect) return; const nextIndex = (selectedMilestoneIndex + 1) % milestones.length; onMilestoneSelect(nextIndex); }; return (
| DESCRIPTION | {unit.toUpperCase()} |
|---|---|
| CURRENT | {Math.floor(stats.totalShares).toLocaleString()} |
| {milestone.description} | {Math.floor(milestone.target).toLocaleString()} |