import React from "react";
import { FileCsvIcon, FileExcelIcon, FileIcon, FileImageIcon, FilePdfIcon, FileTextIcon, FileWordIcon, } from "@navikt/aksel-icons";
const iconProps = {
    fontSize: "2rem",
    "aria-hidden": true,
};
function ItemIcon({ file }) {
    return (React.createElement("div", { className: "aksel-file-item__icon" },
        React.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.createElement(FileImageIcon, Object.assign({}, iconProps));
        case "pdf":
            return React.createElement(FilePdfIcon, Object.assign({}, iconProps));
        case "txt":
            return React.createElement(FileTextIcon, Object.assign({}, iconProps));
        case "csv":
            return React.createElement(FileCsvIcon, Object.assign({}, iconProps));
        case "xls":
        case "xlsx":
            return React.createElement(FileExcelIcon, Object.assign({}, iconProps));
        case "doc":
        case "docx":
            return React.createElement(FileWordIcon, Object.assign({}, iconProps));
        default:
            return React.createElement(FileIcon, Object.assign({}, iconProps));
    }
}
export default ItemIcon;
//# sourceMappingURL=ItemIcon.js.map