import type {ChangeEvent} from "react";

interface PageSizeSelectorProps {
    value: number;
    options: { value: string; label: string; }[];
    onChange: (e: ChangeEvent<HTMLSelectElement>) => void;
}

export const PageSizeSelector = ({value, options, onChange}: PageSizeSelectorProps) => {
    return (
        <>
            <select
                id="pageUnit"
                name="pageUnit"
                className="search_select"
                value={String(value)}
                onChange={onChange}
            >
                {options.map((option) => (
                    <option key={option.value} value={option.value}>
                        {option.label}
                    </option>
                ))}
            </select>
        </>
    )
};
