From 1f0af9e8595aaa7bee96ced5a51b9d2938df25a8 Mon Sep 17 00:00:00 2001 From: Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com> Date: Sun, 6 Oct 2024 07:48:59 +0000 Subject: [PATCH] refactor: simplify handleCopilotChatInputChange by destructuring event object --- src/app/components/Copilot/Copilot.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/Copilot/Copilot.tsx b/src/app/components/Copilot/Copilot.tsx index 1b978b9..37547d1 100644 --- a/src/app/components/Copilot/Copilot.tsx +++ b/src/app/components/Copilot/Copilot.tsx @@ -50,8 +50,8 @@ export function CopilotChat(): React.JSX.Element { // handles the data changes on the chat input. - const handleCopilotChatInputChange = (event: { target: { value: React.SetStateAction; }; }) => { - setData(event.target.value); + const handleCopilotChatInputChange = ({ target: { value } }: React.ChangeEvent) => { + setData(value); }; // handles the ask button click.