"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = useBookState;
const react_1 = require("react");
const __1 = require("../../../../..");
const query_1 = require("../query");
function useBookState() {
    const [listBookState, setListBookState] = (0, react_1.useState)([]);
    const userInfo = (0, __1.PHXFuncGetLoggedInfo)();
    (0, react_1.useEffect)(() => {
        const getData = async () => {
            try {
                const { data: { library_state }, } = await (0, __1.PHXClientQueryV3)({
                    query: query_1.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