const contentTypeIcons = {
  "application/pdf": "fa-solid fa-file-pdf text-danger",
  "application/msword": "fa-solid fa-file-word text-primary",
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
    "fa-solid fa-file-word text-primary",
  "application/vnd.ms-excel": "fa-solid fa-file-excel text-success",
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
    "fa-solid fa-file-excel text-success",
  "application/vnd.ms-powerpoint": "fa-solid fa-file-powerpoint text-warning",
  "application/vnd.openxmlformats-officedocument.presentationml.presentation":
    "fa-solid fa-file-powerpoint text-warning",
  "image/jpg": "fa-solid fa-file-image text-info",
  "image/jpeg": "fa-solid fa-file-image text-info",
  "image/png": "fa-solid fa-file-image text-info",
  "image/gif": "fa-solid fa-file-image text-info",
  "text/plain": "fa-solid fa-file-lines text-secondary",
  "text/csv": "fa-solid fa-file-csv text-success",
  "application/json": "fa-solid fa-file-code text-dark",
  folder: "fa-solid fa-folder text-warning", // special for folders
  default: "fa-solid fa-file text-muted",
};

export const FileIcon = ({ type, size = "fs-4", className = "" }) => {
  const iconClass = contentTypeIcons[type] || contentTypeIcons.default;
  return <i className={`${iconClass} ${size} ${className}`}></i>;
};