import { useQuery } from "@tanstack/react-query" import { PageAssitDatabase } from "~libs/db" import { Empty, Skeleton } from "antd" type Props = {} export const Sidebar = ({}: Props) => { const { data: chatHistories, status } = useQuery({ queryKey: ["fetchChatHistory"], queryFn: async () => { const db = new PageAssitDatabase() const history = await db.getChatHistories() return history } }) return (