/** * BoostMedia AI Content Generator Admin - StatsCard Component * * @package BoostMedia_AI * @license GPL-2.0-or-later */ import type { ReactNode } from 'react' import { TrendingUp, TrendingDown } from 'lucide-react' import { HelpTooltip } from '../common' import { t } from '../../lib/i18n' type StatsCardColor = 'primary' | 'accent' | 'success' | 'warning' | 'error' | 'info' interface StatsCardProps { title: string value: number | string icon: ReactNode trend?: { value: number isPositive: boolean } color?: StatsCardColor subtitle?: string helpText?: string } const colorClasses: Record = { primary: { bg: 'bg-bc-primary-light', icon: 'text-bc-primary', }, accent: { bg: 'bg-bc-accent-light', icon: 'text-bc-accent', }, success: { bg: 'bg-green-50', icon: 'text-green-600', }, warning: { bg: 'bg-yellow-50', icon: 'text-yellow-600', }, error: { bg: 'bg-red-50', icon: 'text-red-600', }, info: { bg: 'bg-blue-50', icon: 'text-blue-600', }, } export function StatsCard({ title, value, icon, trend, color = 'primary', subtitle, helpText, }: StatsCardProps) { const colors = colorClasses[color] return (
{/* Content */}

{title} {helpText && }

{value}

{/* Trend or Subtitle */} {trend ? (
{trend.isPositive ? ( ) : ( )} {trend.value}% {t('from last week')}
) : subtitle ? (

{subtitle}

) : null}
{/* Icon */}
{icon}
) }