import ObjectSelect, { ObjectSelectProps } from "@/components/selects/ObjectSelect/ObjectSelect";
import { AttributeSelectSchema } from "@/lib/client";
import useAttributeSelectsList from "./useAttributeSelectsList";


type Props = Omit<
    ObjectSelectProps<AttributeSelectSchema>,
    "data" | "getLabelFn"
>;

const AttrSelectSelect = (props: Props) => {
    const { selects } = useAttributeSelectsList();

    return (
        <ObjectSelect
            label={"Объект для выбора"}
            getLabelFn={select => select.label}
            data={selects}
            {...props}
        />
    );
};

export default AttrSelectSelect;
