fix(form): show error message when input is empty before submitting form

This commit is contained in:
cfngc4594 2025-03-28 10:42:59 +08:00
parent e490f1bcea
commit 33e19d3318

View File

@ -28,7 +28,10 @@ export default function AiBotPage() {
const handleFormSubmit = useCallback(
(e: React.FormEvent) => {
e.preventDefault();
if (!input.trim()) return;
if (!input.trim()) {
toast.error("Input cannot be empty");
return;
}
const currentCodeMessage = {
id: problemId,