feat: add message request loader

This commit is contained in:
steven
2023-03-27 15:01:48 +08:00
parent e4a77559db
commit c15f572d40
8 changed files with 152 additions and 34 deletions

View File

@ -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 (
<div className="sticky top-0 w-full flex flex-row justify-between items-center lg:grid lg:grid-cols-3 py-2 border-b bg-white z-1">
<div
className={`${
className || ""
} sticky top-0 w-full flex flex-row justify-between items-center lg:grid lg:grid-cols-3 py-2 border-b bg-white z-1`}
>
<div className="ml-2 flex justify-center items-center">
<label htmlFor="connection-drawer" className="w-8 h-8 p-1 mr-1 block lg:hidden rounded-md cursor-pointer hover:bg-gray-100">
<Icon.IoIosMenu className="text-gray-600 w-full h-auto" />