import { FC } from 'react'; import { UsersIcon } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { SectionWidget, ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, } from "@marzneshin/components"; import { Label, Pie, PieChart } from "recharts" const chartConfig = { active: { label: "Active", color: "#3b82f6", }, online: { label: "Online", color: "#10b981", }, expired: { label: "Expired", color: "#4b5563", }, onHold: { label: "On Hold", color: "#A855F7", }, limited: { label: "Limited", color: "#ef4444", }, } satisfies ChartConfig; interface UsersStatsProps { limited: number; active: number; expired: number; on_hold: number; online: number; total: number; } export const UsersStatsWidget: FC = ({ total, limited, active, expired, on_hold, online }) => { const { t } = useTranslation(); const stats = [ { type: "limited", total: limited, fill: "var(--color-limited)" }, { type: "active", total: active, fill: "var(--color-active)" }, { type: "expired", total: expired, fill: "var(--color-expired)" }, { type: "onHold", total: on_hold, fill: "var(--color-onHold)" }, { type: "online", total: online, fill: "var(--color-online)" }, ] return ( {t('users')} } description={t('page.home.users-stats.desc')} className="h-full" > } /> } /> ); };