"use client";

import { FC } from "react";
import useBarcodeTemplateAttributesList from "@/app/barcode-templates/hooks/useBarcodeTemplateAttributesList";
import ObjectMultiSelect, {
    ObjectMultiSelectProps,
} from "@/components/selects/ObjectMultiSelect/ObjectMultiSelect";
import { BarcodeTemplateAttributeSchema } from "@/lib/client";

type Props = Omit<
    ObjectMultiSelectProps<BarcodeTemplateAttributeSchema>,
    "data" | "getLabelFn" | "getValueFn"
>;

const BarcodeTemplateAttributeMultiselect: FC<Props> = (props: Props) => {
    const { barcodeTemplateAttributes } = useBarcodeTemplateAttributesList();

    return (
        <ObjectMultiSelect
            data={barcodeTemplateAttributes}
            {...props}
        />
    );
};

export default BarcodeTemplateAttributeMultiselect;
