| 1 | import { Clock } from 'lucide-react' |
| 2 | |
| 3 | import { Card, CardContent |
| 4 | import { cn } |
| 5 | |
| 6 | interface BudgetStatus { |
| 7 | budget: { |
| 8 | percentageUsed: number |
| 9 | totalApprovedMinutes: number |
| 10 | } |
| 11 | |
| 12 | export function BudgetCard({ |
| 13 | return ( |
| 14 | <Card> |
| 15 | <CardHeader> |
| 16 | <CardTitle className=' |
| 17 | <Clock className=' |
| 18 | Budget |
| 19 | </CardTitle> |
| 20 | </CardHeader> |
| 21 | <CardContent> |
| 22 | <div className='space-y-3 |
| 23 | <div className='flex items-baseline justify-between |
| 24 | <span className='font-semibold text-2xl |
| 25 | {budget.percentageUsed}% |
| 26 | </span> |
| 27 | <span className='text-muted-foreground text-sm |
| 28 | </div> |
| 29 | <div className='h-2 overflow-hidden rounded-full bg-secondary |
| 30 | <div |
| 31 | className={cn( |
| 32 | 'h-full rounded-full transition-all', |
| 33 | budget.percentageUsed >= |
| 34 | ? 'bg-destructive' |
| 35 | : budget.percentageUsed |
| 36 | ? 'bg-amber-500' |
| 37 | : 'bg-emerald-500' |
| 38 | )} |
| 39 | style={{ |
| 40 | width: `${Math. |
| 41 | }} |
| 42 | /> |
| 43 | </div> |
| 44 | <p className='text-muted-foreground text-xs |
| 45 | {Math.floor(budget |
| 46 | {budget.totalApprovedMinutes % |
| 47 | {Math.floor(budget |
| 48 | </p> |
| 49 | </div> |
| 50 | </CardContent> |
| 51 | </Card> |
| 52 | ) |
| 53 | } |