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

type Props = {
    selectId: number;
};

const useAttributeSelectsList = ({ selectId }: Props) => {
    const { data, refetch } = useQuery(
        getAttrSelectOptionsOptions({ path: { selectId } })
    );

    return {
        options: data?.items ?? [],
        refetch,
    };
};

export default useAttributeSelectsList;
