import React, { useState } from 'react'; import type { Annotation } from '@abcvideo/shared'; import { secondsToTimecode } from '../../utils/timecode'; interface Props { annotations: Annotation[]; currentTime: number; onSeek: (time: number) => void; onDelete: (id: string) => void; onExport: (format: string) => void; } export default function AnnotationPanel({ annotations, currentTime, onSeek, onDelete, onExport, }: Props) { const [tab, setTab] = useState<'subtitle' | 'memo'>('subtitle'); const filtered = annotations.filter((a) => a.type === tab); return (
{/* Tabs */}
{(['subtitle', 'memo'] as const).map((t) => ( ))}
{/* List */}
{filtered.length === 0 && (

{tab === 'subtitle' ? '자막이 없습니다' : '메모가 없습니다'}

)} {filtered.map((a) => { const active = currentTime >= a.timeStart && currentTime <= a.timeEnd; return (
onSeek(a.timeStart)} >
{secondsToTimecode(a.timeStart)} → {secondsToTimecode(a.timeEnd)}
{a.text}
); })}
{/* Export buttons */}
{['vtt', 'srt', 'json', 'csv'].map((f) => ( ))}
); }