import { useEffect, useState } from 'react';
import { PHXClientQueryV3, PHXFuncGetLoggedInfo } from '../../../../..';
import { getListBookStateQuery } from '../query';
export default function useBookState() {
    const [listBookState, setListBookState] = useState([]);
    const userInfo = PHXFuncGetLoggedInfo();
    useEffect(() => {
        const getData = async () => {
            try {
                const { data: { library_state }, } = await PHXClientQueryV3({
                    query: getListBookStateQuery,
                    variables: { schoolId: userInfo === null || userInfo === void 0 ? void 0 : userInfo.school_id },
                });
                setListBookState(library_state);
            }
            catch (e) {
                console.error(e);
            }
        };
        getData();
    }, []);
    return { listBookState };
}
//# sourceMappingURL=use-book-state.js.map