import { useEffect } from "react"; import { toastError } from "../lib/toast"; export function useToastOnError(error?: string | null) { useEffect(() => { if (!error) return; toastError(error); }, [error]); }