import { useQuery } from "@tanstack/react-query";
import {
    getBarcodeTemplatesOptions,
    getBarcodeTemplatesQueryKey,
} from "@/lib/client/@tanstack/react-query.gen";

const useBarcodeTemplatesList = () => {
    const { isLoading, data, refetch } = useQuery(getBarcodeTemplatesOptions());

    const queryKey = getBarcodeTemplatesQueryKey();

    return { barcodeTemplates: data?.items ?? [], queryKey, refetch, isLoading };
};

export default useBarcodeTemplatesList;
