import ObjectSelect, {ObjectSelectProps} from "../../ObjectSelect/ObjectSelect.tsx";
import {PayRateSchema} from "../../../client";
import {FC} from "react";
import usePayRatesList from "../../../pages/AdminPage/hooks/usePayRatesList.tsx";

type Props = Omit<ObjectSelectProps<PayRateSchema>, 'data' | 'getValueFn' | 'getLabelFn'>

const PayRateSelect: FC<Props> = (props) => {
    const {objects: payRates} = usePayRatesList();
    return (
        <ObjectSelect
            getValueFn={(baseMarketplace) => baseMarketplace.id.toLocaleString()}
            getLabelFn={(baseMarketplace) => baseMarketplace.name}
            data={payRates}
            {...props}
        />
    )
}
export default PayRateSelect;