import fs from "fs"; import path from "path"; export default async function FilePage({ params, }: { params: Promise<{ path?: string[] }>; }) { const { path: segments = [] } = await params; // <-- FIXED const filePath = segments.join("/") || ""; // Resolve to actual file in /public const fullPath = path.join(process.cwd(), "public", filePath); // 404 if (!fs.existsSync(fullPath)) { return (