import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select";

interface FloorSelectProps {
  selectedFloor?: string;
  onChange: (value: string) => void;
  floors: number[];
}

/**
 * Component chọn tầng (render động từ floors)
 */
export function FloorSelect({ selectedFloor, onChange, floors }: FloorSelectProps) {
  return (
    <Select value={selectedFloor} onValueChange={onChange}>
      <SelectTrigger className="w-[180px]">
        <SelectValue placeholder="Chọn tầng" />
      </SelectTrigger>
      <SelectContent>
        {floors.map((floor) => (
          <SelectItem key={floor} value={floor.toString()}>
            Tầng {floor}
          </SelectItem>
        ))}
      </SelectContent>
    </Select>
  );
}
