"use strict";
exports.__esModule = true;
exports.File = exports.cnFile = void 0;
var tslib_1 = require("tslib");
require("./File.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var FileIconDoc_1 = require("../../fileIcons/FileIconDoc/FileIconDoc");
var FileIconJpg_1 = require("../../fileIcons/FileIconJpg/FileIconJpg");
var FileIconPdf_1 = require("../../fileIcons/FileIconPdf/FileIconPdf");
var FileIconPtt_1 = require("../../fileIcons/FileIconPtt/FileIconPtt");
var FileIconPttx_1 = require("../../fileIcons/FileIconPttx/FileIconPttx");
var FileIconTxt_1 = require("../../fileIcons/FileIconTxt/FileIconTxt");
var bem_1 = require("../../utils/bem");
exports.cnFile = (0, bem_1.cn)('File');
var mapExtensionToSvg = {
    doc: FileIconDoc_1.FileIconDoc,
    docx: FileIconDoc_1.FileIconDoc,
    jpg: FileIconJpg_1.FileIconJpg,
    jpeg: FileIconJpg_1.FileIconJpg,
    pdf: FileIconPdf_1.FileIconPdf,
    ptt: FileIconPtt_1.FileIconPtt,
    ppt: FileIconPtt_1.FileIconPtt,
    pttx: FileIconPttx_1.FileIconPttx,
    pptx: FileIconPttx_1.FileIconPttx,
    txt: FileIconTxt_1.FileIconTxt
};
function getIconByExtension(extension) {
    if (!extension) {
        return FileIconPdf_1.FileIconPdf;
    }
    return mapExtensionToSvg[extension.toLowerCase()] || FileIconPdf_1.FileIconPdf;
}
var File = function (props) {
    var extension = props.extension, className = props.className, otherProps = (0, tslib_1.__rest)(props, ["extension", "className"]);
    var Icon = getIconByExtension(extension);
    return react_1["default"].createElement(Icon, (0, tslib_1.__assign)({ className: (0, exports.cnFile)(null, [className]) }, otherProps));
};
exports.File = File;
