diff --git a/src/SessionMessages/SessionMessagePanel.tsx b/src/SessionMessages/SessionMessagePanel.tsx index eaa128e..742d282 100644 --- a/src/SessionMessages/SessionMessagePanel.tsx +++ b/src/SessionMessages/SessionMessagePanel.tsx @@ -7,10 +7,10 @@ import BackIcon from '@/assets/back.svg?react'; export const SessionMessagePanel: FC = ({ children }) => { const { activeSessionId, theme, isCompact, selectSession, viewType } = useContext(ChatContext); - const isVisible = isCompact && activeSessionId; + const isVisible = (isCompact && activeSessionId) || viewType === 'chat' || !isCompact; return ( - (!isCompact || isVisible) && ( + isVisible && ( { ); }; + +export const Empty = () => { + const [activeId, setActiveId] = useState(); + const [sessions, setSessions] = useState([]); + + return ( +
+ { + const newId = (sessions.length + 1).toLocaleString(); + setSessions([ + ...sessions, + { + id: newId, + title: `New Session #${newId}`, + createdAt: new Date(), + updatedAt: new Date(), + conversations: [] + } + ]); + setActiveId(newId); + }} + onSelectSession={setActiveId} + onDeleteSession={() => alert('delete!')} + > + + + + +

+ Welcome to Reachat, a UI library for effortlessly building and + customizing chat experiences with Tailwind. +

+
+ } + > + {conversations => + conversations.map((conversation, index) => ( + + )) + } + + + + + + ); +};