From b81e2821968e636ae402a71028a2e0c0f7ec15cf Mon Sep 17 00:00:00 2001 From: Shanks0465 Date: Thu, 29 Aug 2024 18:37:43 +0530 Subject: [PATCH 1/7] Empty Input NMT Handling --- frontend/components/TryOut/NMT.tsx | 47 +++++++++++++++++++----------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/frontend/components/TryOut/NMT.tsx b/frontend/components/TryOut/NMT.tsx index 27a5f8b..81635ad 100644 --- a/frontend/components/TryOut/NMT.tsx +++ b/frontend/components/TryOut/NMT.tsx @@ -18,6 +18,7 @@ import { LANGUAGE_CODE_NAMES } from "@/app/config"; import axios from "axios"; import { API_URL } from "@/app/config"; import { IndicTransliterate } from "@ai4bharat/indic-transliterate"; +import { useToast } from "@chakra-ui/react"; const fetchTranslation = async ({ sourceLanguage, @@ -66,9 +67,11 @@ export default function NMT({ const [inputText, setInputText] = useState(""); const [outputText, setOutputText] = useState(""); + const toast = useToast(); + return ( - + @@ -130,26 +133,36 @@ export default function NMT({ }} lang={sourceLanguage} /> - {/*