"use client"; import { Clapperboard, Code2, ExternalLink, Timer } from "lucide-react"; import { useTranslation } from "react-i18next"; import { ChatFileLink } from "@/components/common/ChatFileLink"; import { useInlineFileCardContext } from "@/components/common/InlineFileCard"; import { apiUrl } from "@/lib/api"; import { isChatVideoLessonLink } from "@/lib/chat-file-link"; import type { VideoLessonResult } from "@/lib/video-lesson-types"; export function VideoLessonFrame({ src, title, className, }: { src: string; title: string; className: string; }) { return ( // Scripts are required for the lesson player. The sandbox isolates its origin. ); } export default function VideoLessonViewer({ result, }: { result: VideoLessonResult; }) { const { t } = useTranslation(); const onOpen = useInlineFileCardContext()?.onOpen; const url = result.page.url; const src = url.startsWith("http://") || url.startsWith("https://") ? url : apiUrl(url); const title = result.title || t("Video Lesson"); const actionClass = "inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-[11px] text-[var(--muted-foreground)] transition-colors hover:bg-[var(--muted)] hover:text-[var(--foreground)]"; return (
{result.code}