"use client";

import useBarcodeTemplateSizesList from "@/app/barcode-templates/hooks/useBarcodeTemplateSizesList";
import ObjectSelect, {
    ObjectSelectProps,
} from "@/components/selects/ObjectSelect/ObjectSelect";
import { BarcodeTemplateSizeSchema } from "@/lib/client";

type Props = Omit<ObjectSelectProps<BarcodeTemplateSizeSchema>, "data">;

const BarcodeTemplateSizeSelect = (props: Props) => {
    const { barcodeTemplateSizes } = useBarcodeTemplateSizesList();

    return (
        <ObjectSelect
            data={barcodeTemplateSizes}
            getLabelFn={size => `${size.name} (${size.width}x${size.height})`}
            {...props}
        />
    );
};
export default BarcodeTemplateSizeSelect;
