"use client"; import React from "react"; import { Download, ExternalLink, FileText } from "lucide-react"; import { formatBytes } from "@/shared/lib/format"; import { buildDownloadUrl } from "@/shared/lib/http"; import { FileNode } from "@/shared/types/domain"; import { Badge, Modal } from "@/shared/ui"; interface FilePreviewModalProps { file: FileNode | null; token: string | null; onClose: () => void; } export function FilePreviewModal({ file, token, onClose }: FilePreviewModalProps) { if (!file) return null; const inlineUrl = buildDownloadUrl(file.path, token, true); const downloadUrl = buildDownloadUrl(file.path, token, false); const isAudio = ["mp3", "wav", "ogg"].includes(file.ext); return (
{file.category === "video" && !isAudio ? (
{file.path}
); }