"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const aksel_icons_1 = require("@navikt/aksel-icons");
const iconProps = {
    fontSize: "2rem",
    "aria-hidden": true,
};
function ItemIcon({ file }) {
    return (react_1.default.createElement("div", { className: "aksel-file-item__icon" },
        react_1.default.createElement(Icon, { file: file })));
}
function Icon({ file }) {
    const extension = file.name.substring(file.name.lastIndexOf(".") + 1);
    switch (extension) {
        case "jpg":
        case "jpeg":
        case "png":
        case "gif":
        case "webp":
            return react_1.default.createElement(aksel_icons_1.FileImageIcon, Object.assign({}, iconProps));
        case "pdf":
            return react_1.default.createElement(aksel_icons_1.FilePdfIcon, Object.assign({}, iconProps));
        case "txt":
            return react_1.default.createElement(aksel_icons_1.FileTextIcon, Object.assign({}, iconProps));
        case "csv":
            return react_1.default.createElement(aksel_icons_1.FileCsvIcon, Object.assign({}, iconProps));
        case "xls":
        case "xlsx":
            return react_1.default.createElement(aksel_icons_1.FileExcelIcon, Object.assign({}, iconProps));
        case "doc":
        case "docx":
            return react_1.default.createElement(aksel_icons_1.FileWordIcon, Object.assign({}, iconProps));
        default:
            return react_1.default.createElement(aksel_icons_1.FileIcon, Object.assign({}, iconProps));
    }
}
exports.default = ItemIcon;
//# sourceMappingURL=ItemIcon.js.map