'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 { UserFilters } from '../types';

interface UserManagementFiltersProps {
  filters: UserFilters;
  onSearchChange: (value: string) => void;
  onStatusFilterChange: (value: string) => void;
  onTypeFilterChange: (value: string) => void;
}

export function UserManagementFilters({
  filters,
  onSearchChange,
  onStatusFilterChange,
  onTypeFilterChange
}: UserManagementFiltersProps) {

  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) => onSearchChange(e.target.value)}
              className="pl-10"
            />
          </div>
        </div>
        <Select value={filters.typeFilter} onValueChange={onTypeFilterChange}>
          <SelectTrigger className="w-40">
            <SelectValue />
          </SelectTrigger>
          <SelectContent>
            <SelectItem value="all">全部类型</SelectItem>
            <SelectItem value="super_admin">超级管理员</SelectItem>
            <SelectItem value="enterprise_admin">企业管理员</SelectItem>
            <SelectItem value="employee">员工</SelectItem>
          </SelectContent>
        </Select>
        <Select value={filters.statusFilter} onValueChange={onStatusFilterChange}>
          <SelectTrigger className="w-40">
            <SelectValue />
          </SelectTrigger>
          <SelectContent>
            <SelectItem value="all">全部状态</SelectItem>
            <SelectItem value="active">正常</SelectItem>
            <SelectItem value="frozen">已冻结</SelectItem>
          </SelectContent>
        </Select>
      </div>
    </Card>
  );
}