mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
feat(video): show saved transcripts in the player
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 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