diff --git a/src/components/TextArea.tsx b/src/components/TextArea.tsx index 615971e..5126d6f 100644 --- a/src/components/TextArea.tsx +++ b/src/components/TextArea.tsx @@ -11,6 +11,7 @@ interface TextAreaProps { setDecryptedText: React.Dispatch>; input: string; setInput: React.Dispatch>; + setOutput: React.Dispatch>; setEncryptionEnabled: React.Dispatch>; canvasRef: React.MutableRefObject; handleDecrypt: (encryptedText: string, password: string, setDecryptedText: React.Dispatch>) => void; @@ -19,7 +20,7 @@ interface TextAreaProps { setSize: React.Dispatch>; } -export const TextArea: React.FC = ({ encryptionEnabled, password, setPassword, encryptedText, setDecryptedText, input, setInput, setEncryptionEnabled, canvasRef, handleDecrypt, decryptedText, size, setSize }) => { +export const TextArea: React.FC = ({ encryptionEnabled, password, setPassword, encryptedText, setDecryptedText, input, setInput, setOutput, setEncryptionEnabled, canvasRef, handleDecrypt, decryptedText, size, setSize }) => { const handleCheckboxChange = () => { setEncryptionEnabled(!encryptionEnabled) @@ -95,6 +96,7 @@ export const TextArea: React.FC = ({ encryptionEnabled, password, setInput(e.target.value); if (e.target.value.trim() === '') { clearContx(canvasRef); + setOutput([]); } }} maxLength={512} className="block w-full px-0 text-sm text-gray-800 bg-white border-0 dark:bg-gray-800 focus:ring-0 dark:text-white dark:placeholder-gray-400" placeholder={`${decryptedText ? decryptedText : 'Type your thoughts '}`} required > diff --git a/src/components/Translate.tsx b/src/components/Translate.tsx index 5d3ae3a..bac7d06 100644 --- a/src/components/Translate.tsx +++ b/src/components/Translate.tsx @@ -103,11 +103,11 @@ const Translate: React.FC> = () =>
-