From 29e01721c94e036916c374556a172fd1b52c1f91 Mon Sep 17 00:00:00 2001 From: Ahmad Hassan <76843311+ah7255703@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:18:30 +0200 Subject: [PATCH] fix: Fix error handling in ChatScreen --- copilot-widget/lib/components/Messages.tsx | 48 +++++++++++++++------- copilot-widget/lib/screens/ChatScreen.tsx | 8 ++-- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/copilot-widget/lib/components/Messages.tsx b/copilot-widget/lib/components/Messages.tsx index 5a2369d1e..2f8846072 100644 --- a/copilot-widget/lib/components/Messages.tsx +++ b/copilot-widget/lib/components/Messages.tsx @@ -7,6 +7,10 @@ import { FaRegUserCircle } from "react-icons/fa"; import { format } from "timeago.js"; import cn from "../utils/cn"; import formatTimeFromTimestamp from "../utils/formatTime"; +import { useCopyToClipboard } from "@lib/hooks/useCopy"; +import { HiOutlineClipboard, HiOutlineClipboardCheck } from "react-icons/hi"; +import { FailedMessage, useChat } from "@lib/contexts/Controller"; +import { getLast } from "@lib/utils/utils"; function BotIcon({ error }: { error?: boolean }) { return ( +