import { FC } from "react";
import ObjectSelect, {
    ObjectSelectProps,
} from "@/components/selects/ObjectSelect/ObjectSelect";
import { ServiceCategorySchema } from "@/lib/client";
import useServiceCategoriesList from "@/modules/dealModularEditorTabs/FulfillmentBase/shared/hooks/lists/useServiceCategoriesList";

type Props = Omit<
    ObjectSelectProps<ServiceCategorySchema | null>,
    "data" | "getLabelFn" | "getValueFn"
>;

const ServiceCategorySelect: FC<Props> = props => {
    const { categories } = useServiceCategoriesList();

    return (
        <ObjectSelect
            data={categories}
            {...props}
        />
    );
};

export default ServiceCategorySelect;
