diff --git a/echo/frontend/src/components/chat/TemplatesModal.tsx b/echo/frontend/src/components/chat/TemplatesModal.tsx index 9554bfdb..afc0d0e0 100644 --- a/echo/frontend/src/components/chat/TemplatesModal.tsx +++ b/echo/frontend/src/components/chat/TemplatesModal.tsx @@ -569,6 +569,18 @@ export const TemplatesModal = ({ + + { + e.stopPropagation(); + handleDuplicate(tmpl.title, tmpl.content); + }} + > + + + ({ - label: `${d.label}`, + label: d.label, value: d.language, })); export const languageOptionsByIso639_1 = data.map((d) => ({ - label: `${d.label}`, + label: d.label, value: d.iso639_1, })); @@ -93,37 +95,48 @@ export const LanguagePicker = () => { window.location.href = `/${validLanguage}${newPathname}${search}${hash}`; }; - const handleChange = (e: ChangeEvent) => { - const selectedLanguage = e.target.value; - - if (selectedLanguage === currentLanguage) return; + const handleChange = (value: string | null) => { + if (!value || value === currentLanguage) return; const isInChat = pathname.includes("/chats/"); if (isInChat) { - setPendingLanguage(selectedLanguage); + setPendingLanguage(value); return; } - applyLanguageChange(selectedLanguage); + applyLanguageChange(value); }; return ( <> - - {languageOptions.map((option) => ( - - ))} - + e.stopPropagation()}> +