// STUB — see DMS/pages/_shared/utils.ts. DMS is not migrated; inert placeholder.

export type FileKind =
  | "word"
  | "excel"
  | "ppt"
  | "pdf"
  | "image"
  | "video"
  | "file";

export function detectFileKind(nameOrMime?: string | null): FileKind {
  const s = (nameOrMime ?? "").toLowerCase();
  if (/\.(docx?|word)/.test(s)) return "word";
  if (/\.(xlsx?|csv)/.test(s)) return "excel";
  if (/\.(pptx?)/.test(s)) return "ppt";
  if (/\.pdf/.test(s)) return "pdf";
  if (/\.(png|jpe?g|gif|webp|svg|image)/.test(s)) return "image";
  if (/\.(mp4|mov|avi|video)/.test(s)) return "video";
  return "file";
}
