File size: 1,478 Bytes
7b4250a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { TL } from '../timeline'
import { fmtTime } from './store'

export function Transcript({ onSeek }: { onSeek: (t: number) => void }) {
  return (
    <div className="grid md:grid-cols-2 gap-x-10 gap-y-8">
      {TL.chapters.map((c, ci) => (
        <div key={c.id} className="flex flex-col gap-3">
          <button onClick={() => onSeek(c.start + 0.01)} className="flex items-baseline gap-3 text-left group">
            <span className="qx-brush text-2xl text-[#b8392b]">{c.no}</span>
            <span className="qx-song text-lg text-[#efe6d2] group-hover:text-[#cfa961] tracking-wider">{c.title.replace(/\s/g, '')}</span>
            <span className="text-xs text-[#9d927f] tabular-nums">{fmtTime(c.start)}</span>
          </button>
          <div className="flex flex-col gap-2 border-l border-white/10 pl-4">
            {TL.lines.filter((l) => l.chapter === ci).map((l) => (
              <button key={l.id} onClick={() => onSeek(l.start - 0.3)} className="text-left group">
                {l.kind === 'quote'
                  ? <span className="qx-kai text-[15px] leading-relaxed text-[#e9d7a8] group-hover:text-white">{l.text}</span>
                  : <span className="text-sm leading-relaxed text-[#b9ae98] group-hover:text-[#efe6d2]">{l.text}</span>}
                <span className="ml-2 text-[10px] text-[#6f6656] tabular-nums">{fmtTime(l.start)}</span>
              </button>
            ))}
          </div>
        </div>
      ))}
    </div>
  )
}