import {useGetPatientsQuery} from "../../../../../Api/patientsApi.js";
import {useGetNotIssuedLensesQuery} from "../../../../../Api/lensesApi.js";


const useLensIssueForm = () => {
    const {data: patients = [], isLoading: isLoadingPatients, isError: isErrorPatients} = useGetPatientsQuery(undefined, {
        pollingInterval: 10000,
    });
    const {data: lenses = [], isLoading: isLoadingLenses, isError: isErrorLenses} = useGetNotIssuedLensesQuery(undefined, {
        pollingInterval: 10000,
    });

    return {
        patients,
        lenses,
        isLoading: isLoadingPatients || isLoadingLenses,
        isError: isErrorPatients || isErrorLenses,
    };
};

export default useLensIssueForm;