mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 06:54:28 +00:00
feat(video): add video transcripts (#559)
* feat(video): generate transcripts with the local embedding server * feat(video): show saved transcripts in the player * fix(video): preserve transcript seek timestamps * fix(video): refine transcript viewing and generation * feat(video): resize transcripts and follow playback earlier * fix(video): animate transcript playback scrolling * fix(video): transcribe from the smallest full proxy * fix(video): refine the sync to playback button * feat(video): edit transcript segment text inline * fix(video): keep transcript segment highlighted over edit button * docs(video): note embedding server version for transcripts
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { cn } from '@/ui/lib/utils'
|
||||
import { m } from '@/ui/paraglide/messages.js'
|
||||
import { ListVideo } from 'lucide-react'
|
||||
import type { TranscriptToggle } from '../types'
|
||||
|
||||
export function TranscriptToggleButton({
|
||||
panelId,
|
||||
open,
|
||||
buttonRef,
|
||||
onToggle,
|
||||
className,
|
||||
}: TranscriptToggle & { className?: string }) {
|
||||
return (
|
||||
<button
|
||||
ref={buttonRef}
|
||||
type="button"
|
||||
aria-label={m.transcript_view()}
|
||||
aria-expanded={open}
|
||||
aria-controls={open ? panelId : undefined}
|
||||
title={m.transcript_view()}
|
||||
className={cn(
|
||||
'shrink-0 cursor-pointer rounded transition-colors hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',
|
||||
open && 'text-primary',
|
||||
className,
|
||||
)}
|
||||
onClick={onToggle}
|
||||
>
|
||||
<ListVideo className="size-5" aria-hidden="true" />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user