{/* Title row — title (with hover description) on the left, Close on the right. */}
{/* Hover target is the text itself (inline), not the whole row. */}
{navigated ? liveData?.title ?? "Loading…" : video.title}
{navigated && (
loadVideo(video.id, null)}
title="Back to the original video"
className="shrink-0 inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-lg text-muted hover:text-fg hover:bg-surface transition"
>
Back
)}
{showDesc &&
descRect &&
createPortal(
Description
{detail.isLoading ? (
Loading…
) : detail.data?.description ? (
{renderDescription(detail.data.description, {
currentId: currentVideoId,
onSeek: seekTo,
onLoadVideo: loadVideo,
})}
) : (
No description.
)}
,
document.body
)}
Close
{/* Channel + meta on one line, with the watched toggle pushed to the right.
When navigated to a linked video we only have its author (from the player),
so we show that as plain text and hide feed-video-specific bits. */}
{!navigated && (
)}
{navigated ? (
detail.data?.channel_id ? (
{liveData?.author ?? detail.data.channel_title ?? "Channel"}
) : (
{liveData?.author ?? ""}
)
) : (
{video.channel_title}
)}
{!navigated ? (
{video.view_count != null && · {formatViews(video.view_count)} views }
· {relativeTime(video.published_at)}
{video.duration_seconds != null && (
· {formatDuration(video.duration_seconds)}
)}
{video.live_status === "was_live" && (
stream
)}
) : (
// Linked video's stats come from the (already-fetched) video detail.
{detail.data?.view_count != null && (
· {formatViews(detail.data.view_count)} views
)}
{detail.data?.published_at && · {relativeTime(detail.data.published_at)} }
{detail.data?.duration_seconds != null && (
· {formatDuration(detail.data.duration_seconds)}
)}
)}
{!navigated && (
setWatched(!watched)}
title={watched ? "Watched — click to unmark" : "Mark watched"}
className={
"ml-auto shrink-0 inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-lg transition " +
(watched
? "bg-accent text-accent-fg shadow-sm hover:opacity-90"
: "text-muted hover:text-fg hover:bg-surface border border-border")
}
>
{watched ? : }
{watched ? "Watched" : "Mark watched"}
)}