'use client';

import React from 'react';
import { Card } from '@/components/ui/card';
import { EmployeeManagementStats, Employee } from '../types';

interface EmployeeManagementStatsCardsProps {
  employees: Employee[];
}

export function EmployeeManagementStatsCards({ employees }: EmployeeManagementStatsCardsProps) {
  const stats: EmployeeManagementStats[] = [
    {
      label: '总员工数',
      value: employees.length,
      color: 'text-blue-600',
      bg: 'bg-blue-100',
    },
    {
      label: '正常员工',
      value: employees.filter(e => e.status === 'active').length,
      color: 'text-green-600',
      bg: 'bg-green-100',
    },
    {
      label: '冻结员工',
      value: employees.filter(e => e.status === 'frozen').length,
      color: 'text-gray-600',
      bg: 'bg-gray-100',
    },
  ];

  return (
    <div className="grid grid-cols-3 gap-4">
      {stats.map((stat, index) => (
        <Card key={index} className="p-4">
          <div className="text-sm text-muted-foreground">{stat.label}</div>
          <div className={`mt-2 ${stat.color} text-2xl font-semibold`}>{stat.value}</div>
        </Card>
      ))}
    </div>
  );
}