import {useContext} from "react";
import {PrintContext} from "@/lib/app/contexts/print";

const usePrint = () => {
    const {printDetails, printDispatch} = useContext(PrintContext);

    const setPrintPage = (count) => {
        printDispatch({type: 'SET_PRINT_PAGE', count})
    }

    const setPrintTitle = (title) => {
        printDispatch({type: 'SET_PRINT_TITLE', title})
    }

    return {printDetails, setPrintPage, setPrintTitle}
};

export default usePrint;