"use client"; import { motion, MotionConfig } from "framer-motion"; import { MdChevronRight } from "react-icons/md"; import { useChatsContext } from "@/lib/context/ChatsProvider/hooks/useChatsContext"; import { cn } from "@/lib/utils"; import { ChatsListItem } from "./components/ChatsListItem"; import { MiniFooter } from "./components/ChatsListItem/components/MiniFooter"; import { NewChatButton } from "./components/NewChatButton"; import { useChatsList } from "./hooks/useChatsList"; import { useSelectedChatPage } from "../../[chatId]/hooks/useSelectedChatPage"; export const ChatsList = (): JSX.Element => { const { allChats } = useChatsContext(); const { open, setOpen } = useChatsList(); useSelectedChatPage(); return ( { if (info.offset.x > 100 && !open) { setOpen(true); } else if (info.offset.x < -100 && open) { setOpen(false); } }} className="flex flex-col lg:sticky fixed top-16 left-0 bottom-0 lg:h-[90vh] overflow-visible z-30 border-r border-black/10 dark:border-white/25 bg-white dark:bg-black" >
{allChats.map((chat) => ( ))}
); };