diff options
| author | karpathy <andrej.karpathy@gmail.com> | 2025-11-22 14:27:53 -0800 |
|---|---|---|
| committer | karpathy <andrej.karpathy@gmail.com> | 2025-11-22 14:27:53 -0800 |
| commit | eb0eb26f4cefa4880c895ff017f312e8674f9b73 (patch) | |
| tree | ea20b736519a5b4149b0356fec93447eef950e6b /frontend/src/components/Sidebar.jsx | |
v0
Diffstat (limited to 'frontend/src/components/Sidebar.jsx')
| -rw-r--r-- | frontend/src/components/Sidebar.jsx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx new file mode 100644 index 0000000..c189690 --- /dev/null +++ b/frontend/src/components/Sidebar.jsx @@ -0,0 +1,43 @@ +import { useState, useEffect } from 'react'; +import './Sidebar.css'; + +export default function Sidebar({ + conversations, + currentConversationId, + onSelectConversation, + onNewConversation, +}) { + return ( + <div className="sidebar"> + <div className="sidebar-header"> + <h1>LLM Council</h1> + <button className="new-conversation-btn" onClick={onNewConversation}> + + New Conversation + </button> + </div> + + <div className="conversation-list"> + {conversations.length === 0 ? ( + <div className="no-conversations">No conversations yet</div> + ) : ( + conversations.map((conv) => ( + <div + key={conv.id} + className={`conversation-item ${ + conv.id === currentConversationId ? 'active' : '' + }`} + onClick={() => onSelectConversation(conv.id)} + > + <div className="conversation-title"> + Conversation {conv.id.slice(0, 8)}... + </div> + <div className="conversation-meta"> + {conv.message_count} messages + </div> + </div> + )) + )} + </div> + </div> + ); +} |
