"use client"; import React from 'react'; import { Sparkles } from 'lucide-react'; import { AIGeneratedBadge } from '../ui/ai-generated-badge'; import { Label } from '../ui/label'; import { Textarea } from '../ui/textarea'; import { ConfidenceBadge } from './ai-enrich/ConfidenceBadge'; import { SubtitlesEditor } from './subtitles-editor'; export interface TranscriptSummaryEditorProps { /** Video summary text value - AI-generated from video transcription (defaults to empty string if undefined) */ videoSummary?: string; /** Callback when video summary changes */ onVideoSummaryChange: (value: string) => void; /** Transcript text value (defaults to empty string if undefined) */ transcript?: string; /** Callback when transcript changes */ onTranscriptChange: (value: string) => void; /** Whether content was AI generated */ isAIGenerated?: boolean; /** Confidence score for video summary (0-100) */ videoSummaryConfidence?: number | null; /** Confidence score for transcript (0-100) */ transcriptConfidence?: number | null; /** Custom label for video summary field */ videoSummaryLabel?: string; /** Custom helper text for video summary */ videoSummaryHelperText?: string; /** Custom placeholder for video summary */ videoSummaryPlaceholder?: string; /** Custom label for transcript field */ transcriptLabel?: string; /** Custom helper text for transcript */ transcriptHelperText?: string; /** Custom placeholder for transcript */ transcriptPlaceholder?: string; /** Minimum height for video summary textarea */ videoSummaryMinHeight?: number; /** Minimum height for transcript textarea */ transcriptMinHeight?: number; /** SRT subtitle content */ subtitles?: string; /** Callback when subtitles change */ onSubtitlesChange?: (value: string) => void; /** Custom label for subtitles field */ subtitlesLabel?: string; /** Custom helper text for subtitles */ subtitlesHelperText?: string; /** Custom placeholder for subtitles */ subtitlesPlaceholder?: string; /** Minimum height for subtitles textarea */ subtitlesMinHeight?: number; /** Whether the fields are disabled */ disabled?: boolean; /** Additional class name for the container */ className?: string; } /** * TranscriptSummaryEditor - Unified component for editing transcript and summary with AI badges * * This component provides a consistent UI for both CustomerInterview and ProductRelease entities, * showing AI generation badges and confidence scores when applicable. */ export function TranscriptSummaryEditor({ videoSummary = '', onVideoSummaryChange, transcript = '', onTranscriptChange, isAIGenerated = false, videoSummaryConfidence, transcriptConfidence, videoSummaryLabel = 'Video Summary (Markdown supported)', videoSummaryHelperText = 'AI-generated summary from video content.', videoSummaryPlaceholder = 'Brief summary of the video content...', transcriptLabel = 'Transcript', transcriptHelperText = 'Full transcript with speaker diarization and timestamps', transcriptPlaceholder = '**[00:00] Speaker Name:** Text here...', videoSummaryMinHeight = 200, transcriptMinHeight = 300, subtitles, onSubtitlesChange, subtitlesLabel = 'Subtitles (SRT)', subtitlesHelperText = 'SRT subtitle content generated from transcription. Editable for fine-tuning.', subtitlesPlaceholder = '1\n00:00:00,000 --> 00:00:02,500\nHello, welcome to...', subtitlesMinHeight = 200, disabled = false, className = '', }: TranscriptSummaryEditorProps) { return (
{videoSummaryHelperText}
{transcriptHelperText}