"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var hoist_enum_1 = require("@monstrosity/utilities/hoist-icon-enums/hoist-enum");
var loadable_1 = require("../../primitives/Loadable/loadable");
var icon_1 = require("./icon");
exports.FeatherIcon = function (_a) {
    var icon = _a.icon, size = _a.size;
    var importStatement = function () { return Promise.resolve().then(function () { return __importStar(require("react-feather/dist/icons/" + icon)); }); };
    var fallbackStatement = function () { return require('react-feather')[hoist_enum_1.convert(icon)]; };
    return (react_1.default.createElement(icon_1.IconRoot, null,
        react_1.default.createElement(loadable_1.Loadable, { loadingView: react_1.default.createElement(icon_1.Loader, { size: size }), importStatement: importStatement, fallbackStatement: fallbackStatement, size: size })));
};
