import { useContext } from "react";
import { AnswersContext } from "@/lib/callWidget/contexts/answers";

const useCategories = () => {
    const { categoryLists, subCategoryLists, active_category_id, dispatch } = useContext(AnswersContext);

    const setActiveCategoryID = (tab_id, category_id) => {
        dispatch({ type: "CHANGE_ACTIVE_ID", tab_id, category_id });
    };
    return {
        categoryLists,
        subCategoryLists,
        active_category_id,
        setActiveCategoryID,
    };
};
export default useCategories;
