import { useState } from 'react' import styles from './Sidebar.module.css' function formatThreadLabel(thread) { // Show message preview if available, otherwise fall back to timestamp if (thread.preview) { return thread.preview } const date = new Date(thread.created_at) const today = new Date() const isToday = date.toDateString() === today.toDateString() return isToday ? date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) : date.toLocaleDateString([], { month: 'short', day: 'numeric' }) } export default function Sidebar({ threads, activeThreadId, loading, onSelectThread, onNewChat, onDeleteThread }) { const [collapsed, setCollapsed] = useState(false) return ( ) }