/**
* Stat cards row — ported pixel-for-pixel from clinic-pro-tauri
* `src/components/dashboard/cards/` (index + Card). Exact Tailwind arbitrary
* classes / colors kept; icons are the ported SVGs in `dashboardIcons`.
*/
import React from 'react';
import { UserAddIcon, CardIcon, CardTickIcon, CalendarIcon } from './dashboardIcons';
export interface StatCardModel {
/** background tint of the whole card (source `card_color`) */
cardColor: string;
/** solid background of the round icon bubble (source `icon_color`) */
iconColor: string;
icon: React.ReactNode;
value: React.ReactNode;
label: string;
}
function TauriStatCard({ data }: { data: StatCardModel }) {
return (
{data.icon}
{data.value}
{data.label}
);
}
export interface DashboardStats {
/** تعداد کل مراجعین */
totalPatients: number;
/** کل پرداختیها (ریال) */
totalPaymentsRials: number;
/** پرداختیهای امروز (ریال) */
todayPaymentsRials: number;
/** تعداد نوبتهای امروز */
todayAppointments: number;
}
/**
* 4-card grid. `formatNumber`/`formatRial` are passed in so this stays a pure
* presentational component (SRP) — no coupling to the app's utils.
*/
export function TauriStatCards({
stats,
formatNumber,
formatRial,
}: {
stats: DashboardStats;
formatNumber: (n: number) => string;
formatRial: (rial: number) => string;
}) {
const cards: StatCardModel[] = [
{
cardColor: 'bg-[rgba(241,119,50,0.10)]',
iconColor: 'bg-[#F17732]',
icon: ,
value: `${formatNumber(stats.totalPatients)}+`,
label: 'تعداد کل مراجعین',
},
{
cardColor: 'bg-[rgba(0,157,121,0.10)]',
iconColor: 'bg-[#009D79]',
icon: ,
value: formatRial(stats.totalPaymentsRials),
label: 'کل پرداختیها',
},
{
cardColor: 'bg-[rgba(85,89,206,0.08)]',
iconColor: 'bg-[#5559CE]',
icon: ,
value: formatRial(stats.todayPaymentsRials),
label: 'پرداختیهای امروز',
},
{
cardColor: 'bg-[rgba(255,192,81,0.11)]',
iconColor: 'bg-[#FFC051]',
icon: ,
value: `${formatNumber(stats.todayAppointments)}+`,
label: 'تعداد نوبتهای امروز',
},
];
return (
);
}