import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } /** * Extract the file name from an OSS key / path string. * e.g. "uploads/2024/report.pdf" → "report.pdf" * * Only splits on `/` because OSS object keys use `/` as the separator. * Backslash `\` is NOT treated as a separator — on macOS it can be a * legitimate filename character (e.g. `盘\古\2.1.0\运维手册.docx`). */ export function extractFileName(ossKey: string): string { const parts = ossKey.split("/"); return parts[parts.length - 1] || ossKey; }