diff --git a/src/components/Report/Report.tsx b/src/components/Report/Report.tsx index 211b8a99ef3dccacd095119fc8c26318276407ba..ca2bd50df11de7021db69e8dbdd14aab10f6e71b 100644 --- a/src/components/Report/Report.tsx +++ b/src/components/Report/Report.tsx @@ -3,9 +3,11 @@ import { ToastContainer, toast } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import { FaWallet, FaStar } from "react-icons/fa6"; import ReportModal from "./ReportModal"; +import { useSearchParams } from "react-router-dom"; const Report = () => { - const [report, setReport] = useState(""); + const [searchParams, setSearchParams] = useSearchParams(); + const [report, setReport] = useState(searchParams.get('desc') || ''); const [popUp, setPopUp] = useState(false); const handleReportValid = () => { @@ -41,6 +43,7 @@ const Report = () => { <label> <input type="text" + value={report} onChange={(e) => { setReport(e.target.value); }}