diff --git a/enjoy/src/renderer/components/medias/media-caption.tsx b/enjoy/src/renderer/components/medias/media-caption.tsx index af8739a6..751c885f 100644 --- a/enjoy/src/renderer/components/medias/media-caption.tsx +++ b/enjoy/src/renderer/components/medias/media-caption.tsx @@ -457,18 +457,18 @@ export const MediaCaption = () => { ); }; -const Caption = (props: { +export const Caption = (props: { caption: TimelineEntry; - selectedIndices: number[]; + selectedIndices?: number[]; currentSegmentIndex: number; - activeIndex: number; - displayIpa: boolean; - displayNotes: boolean; - onClick: (index: number) => void; + activeIndex?: number; + displayIpa?: boolean; + displayNotes?: boolean; + onClick?: (index: number) => void; }) => { const { caption, - selectedIndices, + selectedIndices = [], currentSegmentIndex, activeIndex, displayIpa, @@ -504,16 +504,16 @@ const Caption = (props: { id={`word-${currentSegmentIndex}-${index}`} >
onClick(index)} + onClick={() => onClick && onClick(index)} > {word}
diff --git a/enjoy/src/renderer/components/medias/media-transcription-read-button.tsx b/enjoy/src/renderer/components/medias/media-transcription-read-button.tsx index de6bf702..9010bc79 100644 --- a/enjoy/src/renderer/components/medias/media-transcription-read-button.tsx +++ b/enjoy/src/renderer/components/medias/media-transcription-read-button.tsx @@ -48,7 +48,7 @@ import { DefaultAudioLayout, defaultLayoutIcons, } from "@vidstack/react/player/layouts/default"; -import { RecordingDetail } from "@renderer/components"; +import { Caption, RecordingDetail } from "@renderer/components"; const TEN_MINUTES = 60 * 10; let interval: NodeJS.Timeout; @@ -112,16 +112,22 @@ export const MediaTranscriptionReadButton = () => {

{media.name}

- {transcription.result.timeline.map( - (sentence: TimelineEntry, index: number) => ( -
- - #{index + 1} - -
{sentence.text}
-
- ) - )} + {open && + transcription.result.timeline.map( + (sentence: TimelineEntry, index: number) => ( +
+ + #{index + 1} + + +
+ ) + )}
{recordings.map((recording) => (