import { Box, Text, IconButton } from "@chakra-ui/react"; import { ChevronUp } from "lucide-react"; import { Topic } from "../../webSocketTypes"; import { getTopicColor } from "../../../../lib/topicColors"; import { TOPICS_SCROLL_DIV_ID } from "./constants"; interface TranscriptWithGutterProps { topics: Topic[]; getSpeakerName: (speakerNumber: number) => string | undefined; onGutterClick: (topicId: string) => void; } export function TranscriptWithGutter({ topics, getSpeakerName, onGutterClick, }: TranscriptWithGutterProps) { const scrollToTopics = () => { // Scroll to the topic list at the top const topicList = document.getElementById(TOPICS_SCROLL_DIV_ID); if (topicList) { topicList.scrollIntoView({ behavior: "smooth", block: "start", }); } }; return ( {topics.map((topic, topicIndex) => { const color = getTopicColor(topicIndex); return ( {/* Topic Header with Up Button */} {topic.title} {/* Segments container with single gutter */} {/* Single continuous gutter for entire topic */} onGutterClick(topic.id)} /> {/* Segments */} {topic.segments?.map((segment, segmentIndex) => ( {/* Segment Content */} {getSpeakerName(segment.speaker) || `Speaker ${segment.speaker}`} : {" "} {segment.text} ))} ); })} ); }