"use client"; import React from 'react'; import { Label } from '../ui/label'; import { Textarea } from '../ui/textarea'; import { Badge } from '../ui/badge'; import { StandardCcIcon } from '../icons-v2-generated'; export interface SubtitlesEditorProps { /** SRT subtitle content */ subtitles?: string; /** Callback when subtitles change */ onSubtitlesChange?: (value: string) => void; /** Custom label for subtitles field */ label?: string; /** Custom helper text */ helperText?: string; /** Custom placeholder */ placeholder?: string; /** Minimum height for the textarea */ minHeight?: number; /** Show the AI Generated badge next to the label (when content exists) */ isAIGenerated?: boolean; /** Whether the field is disabled */ disabled?: boolean; /** DOM id for the textarea/label pair (unique per instance on a page) */ id?: string; /** Additional class name */ className?: string; } /** * SubtitlesEditor — THE single SRT-editing surface. * * Extracted from TranscriptSummaryEditor so the MAIN video's subtitles * (srt_content) and the HIGHLIGHT reel's subtitles (highlight_srt_content) * render through the exact same component: same textarea, same AI badge, * same helper-text layout. Renders nothing when neither content nor a * change handler is provided (same convention the inline block had). */ export function SubtitlesEditor({ subtitles, onSubtitlesChange, label = 'Subtitles (SRT)', helperText = 'SRT subtitle content generated from transcription. Editable for fine-tuning.', placeholder = '1\n00:00:00,000 --> 00:00:02,500\nHello, welcome to...', minHeight = 200, isAIGenerated = false, disabled = false, id = 'subtitles', className = '', }: SubtitlesEditorProps) { if (!subtitles && !onSubtitlesChange) return null; return (
{helperText}