"use client";

import { StatsSelect } from './stats-select';
import { StatsOverview } from '@/lib/types';
import { useStatsData } from '@/lib/hooks/use-stats-data';

interface StatusSelectorProps {
  value: string;
  onValueChange: (value: string) => void;
  stats: StatsOverview | null;
  showNoneOption?: boolean;
  noneOptionLabel?: string;
  placeholder?: string;
  inputPlaceholder?: string;
  className?: string;
  disabled?: boolean;
}

export function StatusSelector({
  value,
  onValueChange,
  stats,
  showNoneOption = false,
  noneOptionLabel = "不修改",
  placeholder = "选择状态",
  inputPlaceholder = "或直接输入状态",
  className,
  disabled = false
}: StatusSelectorProps) {
  const { statuses } = useStatsData(stats);

  return (
    <StatsSelect
      value={value}
      onValueChange={onValueChange}
      placeholder={placeholder}
      inputPlaceholder={inputPlaceholder}
      items={statuses}
      showNoneOption={showNoneOption}
      noneOptionLabel={noneOptionLabel}
      className={className}
      disabled={disabled}
    />
  );
}