import { motion } from 'framer-motion'; import { cn, formatAmount } from '@/lib/utils'; import { DirhamIcon } from '@/components/ui/custom-icons'; import React from 'react'; interface BudgetRingProps { spent: number; total: number; label: string; color?: string; size?: 'sm' | 'md' | 'lg'; } export const BudgetRing = ({ spent, total, label, color = "text-primary", size = "md" }: BudgetRingProps) => { const percentage = Math.min(100, Math.max(0, (spent / total) * 100)); const radius = size === 'sm' ? 20 : size === 'md' ? 30 : 40; const strokeWidth = size === 'sm' ? 4 : size === 'md' ? 6 : 8; const circumference = 2 * Math.PI * radius; const strokeDashoffset = circumference - (percentage / 100) * circumference; return (
{/* Background Circle */} {/* Progress Circle */}
{Math.round(percentage)}%

{label}

{formatAmount(spent)}
/
{formatAmount(total)}
); };