import { ImageResolution } from '../../types/image';

interface ResolutionSelectProps {
  resolutions: ImageResolution[];
  selectedResolution: string;
  onChange: (resolutionId: string) => void;
  disabled?: boolean;
}

export function ResolutionSelect({
  resolutions,
  selectedResolution,
  onChange,
  disabled = false
}: ResolutionSelectProps) {
  return (
    <div className="space-y-2">
      <label className="block text-sm font-medium text-gray-700">
        Выбор разрешения
      </label>
      <select
        value={selectedResolution}
        onChange={(e) => onChange(e.target.value)}
        disabled={disabled}
        className="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50"
      >
        {resolutions.map((resolution) => (
          <option key={resolution.id} value={resolution.id}>
            {resolution.label}
          </option>
        ))}
      </select>
    </div>
  );
}