import { ticksToSeconds } from '../../lib/format'
interface Chapter {
StartPositionTicks?: number | null
Name?: string | null
}
interface Props {
chapters?: Chapter[] | null
duration: number
onJump?: (seconds: number) => void
}
export default function ChapterTicks({ chapters, duration, onJump }: Props) {
if (!chapters?.length || !duration) return null
return (
{chapters.map((c, i) => {
const start = ticksToSeconds(c.StartPositionTicks)
if (start <= 0 || start >= duration) return null
const left = (start / duration) * 100
return (
)
}