From c15f572d40d8ff69dd59ca590e6a7db25ca902cd Mon Sep 17 00:00:00 2001 From: steven Date: Mon, 27 Mar 2023 15:01:48 +0800 Subject: [PATCH] feat: add message request loader --- components/ChatView/Header.tsx | 13 +++++- components/ChatView/MessageTextarea.tsx | 1 + components/ChatView/MessageView.tsx | 22 +++++----- components/ChatView/index.tsx | 53 ++++++++++++++++++++----- components/EmptyView.tsx | 47 ++++++++++++++++++++-- components/MessageLoader.tsx | 27 +++++++++++++ store/message.ts | 22 +++++++--- types/message.ts | 1 + 8 files changed, 152 insertions(+), 34 deletions(-) create mode 100644 components/MessageLoader.tsx diff --git a/components/ChatView/Header.tsx b/components/ChatView/Header.tsx index 4882d6b..9c87ee7 100644 --- a/components/ChatView/Header.tsx +++ b/components/ChatView/Header.tsx @@ -2,7 +2,12 @@ import { useEffect } from "react"; import { useChatStore } from "@/store"; import Icon from "../Icon"; -const Header = () => { +interface Props { + className?: string; +} + +const Header = (props: Props) => { + const { className } = props; const chatStore = useChatStore(); const currentChat = chatStore.currentChat; const title = currentChat?.title || "SQL Chat"; @@ -12,7 +17,11 @@ const Header = () => { }, [title]); return ( -
+