"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _getIcon = (mtype, icon, iconMap) => {
  if (icon == undefined || icon === false) {
    return undefined;
  }
  if (iconMap) {
    var i1 = iconMap[mtype];
    if (i1) {
      return i1;
    }
  }
  if (icon) {
    return icon;
  }
  return 'file';
};
var useFileTypeIcon = (mtype, icon, iconMap) => {
  var [theIcon, setTheIcon] = (0, _react.useState)(_getIcon(mtype, icon, iconMap));
  (0, _react.useEffect)(() => {
    setTheIcon(_getIcon(mtype, icon, iconMap));
  }, [mtype, icon, iconMap]);
  return theIcon;
};
var _default = useFileTypeIcon;
exports.default = _default;