import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { ExternalLink, Download, FileText, Video, Music, Image, Link2 } from "lucide-react"; import { API_BASE_URL } from "@/lib/api-client"; import type { ChapterMaterial, MaterialType } from "@/types/courseware"; interface MaterialViewerProps { material: ChapterMaterial | null; open: boolean; onOpenChange: (open: boolean) => void; onDownload?: (materialId: number, name: string) => void; } const typeLabels: Record = { pdf: "PDF Document", document: "Document", video: "Video", audio: "Audio", image: "Image", link: "External Link", article: "Article", }; const typeIcons: Record = { pdf: , document: , video: