o2o-clinicad-frontend/src/features/home/hooks/useAnalyze.ts

16 lines
351 B
TypeScript

import { useState } from "react";
import { useNavigate } from "react-router-dom";
export function useAnalyze() {
const [url, setUrl] = useState("");
const navigate = useNavigate();
const handleAnalyze = () => {
if (url.trim()) {
navigate("/report/loading", { state: { url } });
}
};
return { url, setUrl, handleAnalyze };
}