Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions apps/docs/components/ui/video-chapters.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client'

import { useEffect, useState } from 'react'
import { CirclePlay } from 'lucide-react'
import { cn } from '@/lib/utils'

/** Parse a chapter timestamp ("M:SS" or "H:MM:SS") into seconds. */
Expand All @@ -26,9 +25,10 @@ interface VideoChaptersProps {
}

/**
* Right-rail panel listing the current video's chapters, styled to match the
* Academy's course panels. Rows are skip-to controls; they activate once the
* lesson's video is recorded.
* Right-rail list of the current video's chapters — flat and borderless to
* match the docs' "On this page" TOC (small muted label, hover-highlighted
* rows). Rows are skip-to controls; they activate once the lesson's video is
* recorded.
*/
export function VideoChapters({ title = 'Chapters', chapters, className }: VideoChaptersProps) {
// Chapters only seek when a VideoPlaceholder with a real video is on the page.
Expand All @@ -42,13 +42,8 @@ export function VideoChapters({ title = 'Chapters', chapters, className }: Video
}, [])

return (
<aside
className={cn(
'not-prose rounded-xl border border-[var(--border-1)] bg-[var(--surface-3)] p-5',
className
)}
>
<h2 className='mt-0 mb-3 font-semibold text-[var(--text-primary)] text-lg'>{title}</h2>
<aside className={cn('not-prose', className)}>
<p className='mb-2 px-2.5 font-medium text-[0.8125rem] text-[var(--text-muted)]'>{title}</p>
<ul className='m-0 flex list-none flex-col gap-0.5 p-0'>
{chapters.map((chapter) => (
<li key={chapter.title}>
Expand All @@ -61,12 +56,11 @@ export function VideoChapters({ title = 'Chapters', chapters, className }: Video
new CustomEvent('academy:seek', { detail: { time: parseTime(chapter.time) } })
)
}}
className='flex w-full cursor-pointer items-start gap-2.5 rounded-lg px-2.5 py-2 text-left text-[var(--text-secondary)] text-sm transition-colors hover:bg-[var(--surface-active)] disabled:cursor-default disabled:hover:bg-transparent'
className='flex w-full cursor-pointer items-baseline gap-3 rounded-lg px-2.5 py-2 text-left text-[var(--text-secondary)] text-sm transition-colors hover:bg-[var(--surface-active)] disabled:cursor-default disabled:hover:bg-transparent'
>
<CirclePlay className='mt-0.5 size-4 shrink-0' />
<span className='min-w-0 flex-1 break-words'>{chapter.title}</span>
{chapter.time && (
<span className='mt-0.5 shrink-0 text-[var(--text-muted)] text-xs tabular-nums'>
<span className='shrink-0 text-[var(--text-muted)] text-xs tabular-nums'>
{chapter.time}
</span>
)}
Expand Down
24 changes: 12 additions & 12 deletions apps/docs/components/ui/what-you-will-learn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ interface WhatYouWillLearnProps {
className?: string
}

/** A bordered "What you will learn" card listing lesson takeaways. */
/**
* "What you will learn" — a flat callout matching the docs' flat/divider
* language. A quiet muted label (like the TOC heading) sits above the
* takeaways; dividers fall only between items, so the label reads as a marker
* rather than an underlined heading and never competes with the item titles.
*/
export function WhatYouWillLearn({ items, className }: WhatYouWillLearnProps) {
return (
<div
className={cn(
'not-prose rounded-xl border border-[var(--border-1)] bg-[var(--surface-3)] p-6',
className
)}
>
<h2 className='mt-0 mb-5 font-semibold text-[var(--text-primary)] text-xl'>
<div className={cn('not-prose', className)}>
<p className='mb-3 font-medium text-[0.8125rem] text-[var(--text-muted)]'>
What you will learn
</h2>
<div className='flex flex-col gap-5'>
</p>
<div className='divide-y divide-[var(--border)]'>
{items.map((item) => (
<div key={item.title}>
<p className='mb-1 font-semibold text-[var(--text-primary)] text-sm'>{item.title}</p>
<div key={item.title} className='py-3.5 first:pt-0 last:pb-0'>
<p className='mb-1 font-medium text-[var(--text-primary)] text-sm'>{item.title}</p>
<p className='m-0 text-[var(--text-secondary)] text-sm leading-relaxed'>{item.body}</p>
</div>
))}
Expand Down
Loading