/**
* Ported clinic/doctor dashboard view — pixel-for-pixel from clinic-pro-tauri
* `src/components/dashboard/index.jsx` (Cards → Charts → New-appointments list,
* stacked with 24px gaps). Purely presentational; both ClinicDashboard and
* DoctorDashboard feed it their (real-API) data.
*/
import React from 'react';
import { Link } from 'react-router-dom';
import { TauriStatCards, type DashboardStats } from './TauriStatCards';
import { TauriBarChart, TauriLineChart, type ChartPoint } from './TauriCharts';
import { NewAppointmentsTable, type ApptRow } from './NewAppointmentsTable';
/** small cosmetic dropdown — mirrors source SmSelector (does not drive data) */
function SmSelector({ options }: { options: string[] }) {
return (
{options.map((o) => (
{o}
))}
);
}
function ChartTitle({ text }: { text: string }) {
return {text}
;
}
function ChartCard({ title, selectorOptions, children }: { title: string; selectorOptions: string[]; children: React.ReactNode }) {
return (
);
}
const MONTHS = ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'];
const YEARS = ['سال ۱۴۰۳', 'سال ۱۴۰۲', 'سال ۱۴۰۱', 'سال ۱۴۰۰'];
export interface TauriDashboardViewProps {
stats: DashboardStats;
/** «نمودار تعداد بیماران» series (appointments_by_day) */
patientBars: ChartPoint[];
/** «میزان درآمد» series (revenue_by_day) */
incomeLine: ChartPoint[];
appointments: ApptRow[];
loading: boolean;
formatNumber: (n: number) => string;
formatRial: (rial: number) => string;
}
export function TauriDashboardView({
stats,
patientBars,
incomeLine,
appointments,
loading,
formatNumber,
formatRial,
}: TauriDashboardViewProps) {
return (
{/* Cards */}
{/* Charts — grid-2 (1fr 1fr, collapses to 1fr on narrow) for reliable
full-width equal columns, matching the rest of the admin dashboard */}
{/* New appointments list */}
لیست نوبتهای جدید
نوبتها
);
}