/** * Карточка со статистикой для Dashboard (iOS 26). * Переиспользуется для ментора, клиента, родителя и др. ролей. */ 'use client'; import React from 'react'; import { Panel } from './ui/Panel'; export interface StatCardProps { title: string; value: string | number; icon?: React.ReactNode; trend?: { value: number; isPositive: boolean; }; loading?: boolean; subtitle?: string; } export const StatCard: React.FC = ({ title, value, icon, trend, loading = false, subtitle, }) => { if (loading) { return (
); } return (

{title}

{subtitle && (

{subtitle}

)}
{icon && (
{icon}
)}

{value}

{trend && ( {trend.isPositive ? '+' : '-'} {Math.abs(trend.value)}% )}
); };