16 lines
351 B
TypeScript
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 };
|
|
}
|