import { useEffect } from 'react' import { useAtomValue } from 'jotai' import { twMerge } from 'tailwind-merge' import { searchAtom } from '@/containers/Providers/Jotai' import useGetUserConversations from '@/hooks/useGetUserConversations' import HistoryItem from '../HistoryItem' import SidebarEmptyHistory from '../SidebarEmptyHistory' import { userConversationsAtom } from '@/helpers/atoms/Conversation.atom' const HistoryList: React.FC = () => { const conversations = useAtomValue(userConversationsAtom) const searchText = useAtomValue(searchAtom) const { getUserConversations } = useGetUserConversations() useEffect(() => { getUserConversations() // eslint-disable-next-line react-hooks/exhaustive-deps }, []) return (
{conversations.length > 0 ? ( ) : ( )}
) } export default HistoryList