add onClick prop to thread selector

This commit is contained in:
Ajay Bura 2025-11-03 15:28:42 +05:30
parent 38cc6e6f3a
commit 3d4c91c969

View file

@ -13,18 +13,22 @@ export function ThreadSelectorContainer({ children }: { children: ReactNode }) {
type ThreadSelectorProps = { type ThreadSelectorProps = {
room: Room; room: Room;
threadId: string;
threadDetail: IThreadBundledRelationship; threadDetail: IThreadBundledRelationship;
outlined?: boolean; outlined?: boolean;
hour24Clock: boolean; hour24Clock: boolean;
dateFormatString: string; dateFormatString: string;
onClick?: (threadId: string) => void;
}; };
export function ThreadSelector({ export function ThreadSelector({
room, room,
threadId,
threadDetail, threadDetail,
outlined, outlined,
hour24Clock, hour24Clock,
dateFormatString, dateFormatString,
onClick,
}: ThreadSelectorProps) { }: ThreadSelectorProps) {
const latestEvent = threadDetail.latest_event; const latestEvent = threadDetail.latest_event;
@ -43,6 +47,7 @@ export function ThreadSelector({
className={classNames(css.ThreadSelector, outlined && css.ThreadSectorOutlined)} className={classNames(css.ThreadSelector, outlined && css.ThreadSectorOutlined)}
alignItems="Center" alignItems="Center"
gap="300" gap="300"
onClick={() => onClick?.(threadId)}
> >
<Box className={css.ThreadRepliesCount} shrink="No" alignItems="Center" gap="200"> <Box className={css.ThreadRepliesCount} shrink="No" alignItems="Center" gap="200">
<Icon size="100" src={Icons.Thread} filled /> <Icon size="100" src={Icons.Thread} filled />