/** * FileTabs — tab bar for open files in the preview panel. */ import { X, FileText, FileCode, FileSpreadsheet } from "lucide-react"; import { cn } from "../lib/utils"; export interface FileTabData { id: string; name: string; path: string; dirty?: boolean; } export interface FileTabsProps { tabs: FileTabData[]; activeId?: string; onSelect: (id: string) => void; onClose: (id: string) => void; className?: string; } function getTabIcon(name: string) { const ext = name.split(".").pop()?.toLowerCase() || ""; if (["pdf"].includes(ext)) return FileText; if (["csv", "xlsx"].includes(ext)) return FileSpreadsheet; return FileCode; } export function FileTabs({ tabs, activeId, onSelect, onClose, className }: FileTabsProps) { if (tabs.length === 0) return null; return (