mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 06:24:30 +00:00
32 lines
861 B
TypeScript
32 lines
861 B
TypeScript
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>
|
|
)
|
|
}
|