mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +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(
|
||||
(e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!input.trim()) return;
|
||||
if (!input.trim()) {
|
||||
toast.error("Input cannot be empty");
|
||||
return;
|
||||
}
|
||||
|
||||
const currentCodeMessage = {
|
||||
id: problemId,
|
||||
|
Loading…
Reference in New Issue
Block a user