ThreadListProps
Unpublished development API. This package is under development and is not available as a published release.
Supplies ordered conversations and controlled selection, with creation, row rendering, action, and context-menu hooks.
import type { ThreadListProps } from '@threadplane/react/chat';Declaration
export interface ThreadListProps {
readonly actions?: ThreadActionAdapter | null;
readonly activeThreadId?: string | null;
readonly className?: string;
readonly label?: string;
readonly mode?: 'active' | 'archived';
readonly newThreadDisabled?: boolean;
readonly newThreadLabel?: string;
readonly now?: number;
readonly onContextMenu?: (threadId: string, event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
readonly onNewThread?: () => void;
readonly onSelect: (threadId: string) => void;
readonly projects?: readonly {
readonly id: string;
readonly name: string;
}[] | null;
readonly renderActions?: (thread: ThreadListItem) => ReactNode;
readonly renderItem?: (thread: ThreadListItem, isActive: boolean) => ReactNode;
readonly renderTitle?: (thread: ThreadListItem) => ReactNode;
readonly threads: readonly ThreadListItem[];
}Members
actions
Adds a built-in menu to each row with the commands supplied here, inline
rename, and a confirmation before delete. Rows drawn by renderItem get
no menu.
readonly actions?: ThreadActionAdapter | null;activeThreadId
readonly activeThreadId?: string | null;className
readonly className?: string;label
readonly label?: string;mode
Which commands the built-in menu offers: archived rows can be restored or deleted.
readonly mode?: 'active' | 'archived';newThreadDisabled
readonly newThreadDisabled?: boolean;newThreadLabel
readonly newThreadLabel?: string;now
readonly now?: number;onContextMenu
Synchronous context request from the selection button; the owner claims input.
readonly onContextMenu?: (threadId: string, event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;onNewThread
readonly onNewThread?: () => void;onSelect
readonly onSelect: (threadId: string) => void;projects
Destinations for the built-in Move to project command.
readonly projects?: readonly {
readonly id: string;
readonly name: string;
}[] | null;renderActions
App-owned controls rendered beside the selection button.
readonly renderActions?: (thread: ThreadListItem) => ReactNode;renderItem
Replaces the complete row content; owner supplies controls and accessibility.
readonly renderItem?: (thread: ThreadListItem, isActive: boolean) => ReactNode;renderTitle
Noninteractive phrasing content inside the row button. Original title/id labels remain.
readonly renderTitle?: (thread: ThreadListItem) => ReactNode;threads
readonly threads: readonly ThreadListItem[];