'use client';

import React from 'react';
import { Card } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { Search } from 'lucide-react';
import { EmployeeFilters } from '../types';

interface EmployeeManagementFiltersProps {
  filters: EmployeeFilters;
  onFiltersChange: (filters: EmployeeFilters) => void;
}

export function EmployeeManagementFilters({
  filters,
  onFiltersChange
}: EmployeeManagementFiltersProps) {
  const updateFilter = (key: keyof EmployeeFilters, value: string) => {
    onFiltersChange({
      ...filters,
      [key]: value
    });
  };

  return (
    <Card className="p-4">
      <div className="flex gap-4">
        <div className="flex-1">
          <div className="relative">
            <Search className="absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground" />
            <Input
              placeholder="搜索员工姓名、用户名、电话、部门..."
              value={filters.searchKeyword}
              onChange={(e) => updateFilter('searchKeyword', e.target.value)}
              className="pl-10"
            />
          </div>
        </div>
        <Select value={filters.statusFilter} onValueChange={(value) => updateFilter('statusFilter', value)}>
          <SelectTrigger className="w-40">
            <SelectValue />
          </SelectTrigger>
          <SelectContent>
            <SelectItem value="all">全部状态</SelectItem>
            <SelectItem value="active">正常</SelectItem>
            <SelectItem value="frozen">已冻结</SelectItem>
          </SelectContent>
        </Select>
      </div>
    </Card>
  );
}