chore: 删除未使用的 Sidebar SessionSelector(已移至 Header)
This commit is contained in:
parent
6f33ec7604
commit
02339465b6
@ -1,78 +0,0 @@
|
|||||||
import { MessageSquare } from 'lucide-react'
|
|
||||||
import type { SessionSummary } from '../../types/protocol'
|
|
||||||
|
|
||||||
interface SessionSelectorProps {
|
|
||||||
sessions: SessionSummary[]
|
|
||||||
selectedSessionId: string | null
|
|
||||||
onSelectSession: (sessionId: string) => void
|
|
||||||
}
|
|
||||||
|
|
||||||
export function SessionSelector({
|
|
||||||
sessions,
|
|
||||||
selectedSessionId,
|
|
||||||
onSelectSession,
|
|
||||||
}: SessionSelectorProps) {
|
|
||||||
if (sessions.length === 0) {
|
|
||||||
return (
|
|
||||||
<div className="border-b border-[var(--border-color)] px-4 py-2.5">
|
|
||||||
<p className="text-xs text-[var(--text-muted)]">暂无会话</p>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="border-b border-[var(--border-color)]">
|
|
||||||
<div className="px-4 py-2 flex items-center justify-between">
|
|
||||||
<span className="text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--text-muted)]">
|
|
||||||
会话
|
|
||||||
</span>
|
|
||||||
<span className="text-[10px] text-[var(--text-muted)]">{sessions.length}</span>
|
|
||||||
</div>
|
|
||||||
<div className="max-h-40 overflow-y-auto px-2 pb-2">
|
|
||||||
{sessions.map((s) => {
|
|
||||||
const isActive = s.session_id === selectedSessionId
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
key={s.session_id}
|
|
||||||
onClick={() => onSelectSession(s.session_id)}
|
|
||||||
className={`
|
|
||||||
group relative w-full flex items-center gap-2.5 px-2 py-2 rounded-lg text-left
|
|
||||||
transition-all duration-150
|
|
||||||
${isActive
|
|
||||||
? 'bg-[var(--accent-cyan)]/10'
|
|
||||||
: 'hover:bg-[var(--overlay-hover)]'
|
|
||||||
}
|
|
||||||
`}
|
|
||||||
>
|
|
||||||
{/* Left accent bar */}
|
|
||||||
<div
|
|
||||||
className={`
|
|
||||||
absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-4 rounded-r-full
|
|
||||||
transition-all duration-200
|
|
||||||
${isActive ? 'bg-[var(--accent-cyan)]' : 'bg-transparent'}
|
|
||||||
`}
|
|
||||||
/>
|
|
||||||
<MessageSquare
|
|
||||||
className={`h-3.5 w-3.5 flex-shrink-0 ${
|
|
||||||
isActive ? 'text-[var(--accent-cyan)]' : 'text-[var(--text-muted)]'
|
|
||||||
}`}
|
|
||||||
/>
|
|
||||||
<div className="flex-1 min-w-0">
|
|
||||||
<div
|
|
||||||
className={`text-xs truncate ${
|
|
||||||
isActive ? 'text-[var(--text-primary)] font-medium' : 'text-[var(--text-secondary)]'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{s.title}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<span className="text-[10px] text-[var(--text-muted)] flex-shrink-0">
|
|
||||||
{s.message_count}
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user