import SelectInput from '../input/SelectInput';

export interface OptionType {
  label: string;
  value: string | number;
}

interface TableRowSizeSelectorProps {
  value: number;
  onChange: (val: OptionType | OptionType[] | null) => void;
  options: OptionType[];
}

export const TableRowSizeSelector = ({
  value,
  onChange,
  options,
}: TableRowSizeSelectorProps) => {
  return (
    <div className='flex flex-row justify-end'>
      <SelectInput
        label='Baris'
        options={options}
        value={{
          label: String(value),
          value: value,
        }}
        onChange={onChange}
        className={{ wrapper: 'max-w-28' }}
      />
    </div>
  );
};
