mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
fix(form): show error message when input is empty before submitting form
This commit is contained in:
parent
e490f1bcea
commit
33e19d3318
@ -28,7 +28,10 @@ export default function AiBotPage() {
|
|||||||
const handleFormSubmit = useCallback(
|
const handleFormSubmit = useCallback(
|
||||||
(e: React.FormEvent) => {
|
(e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!input.trim()) return;
|
if (!input.trim()) {
|
||||||
|
toast.error("Input cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const currentCodeMessage = {
|
const currentCodeMessage = {
|
||||||
id: problemId,
|
id: problemId,
|
||||||
|
Loading…
Reference in New Issue
Block a user