import type { AgentMessageRecord, CommentRecord, TaskRecord, MessageChannel } from "@shared/types" import { CaretDown } from "@phosphor-icons/react" import { useT } from "../../i18n" export interface ChannelDescriptor { key: string kind: "message" channel: MessageChannel label: string targetId: string | null agentId: string | null participantIds: string[] } export interface TaskDiscussionDescriptor { key: string kind: "task" taskId: string label: string } export type AnyChannel = ChannelDescriptor | TaskDiscussionDescriptor interface ChannelHeaderProps { activeChannel: AnyChannel | null showSidebar: boolean onShowSidebar: () => void channelMessages: AgentMessageRecord[] taskDiscussionComments: CommentRecord[] activeTask: TaskRecord | null unreadByChannel: Map onNavigateToTask: (taskId: string) => void filterBar: React.ReactNode } export function ChannelHeader({ activeChannel, showSidebar, onShowSidebar, channelMessages: _channelMessages, taskDiscussionComments: _taskDiscussionComments, activeTask, unreadByChannel: _unreadByChannel, onNavigateToTask, filterBar, }: ChannelHeaderProps) { const t = useT() return (
{!showSidebar ? ( ) : null} {activeChannel ? (
{activeChannel.label}
{activeChannel.kind === "task" && activeTask ? ( ) : null}
) : ( {t("comm.selectChannel")} )}
{filterBar}
) }