"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StepIcon = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const constants_1 = require("../constants");
const styles_1 = require("./styles");
exports.StepIcon = (0, react_1.memo)((props) => {
    const { active, completed, error, isSelected, icon: Icon } = props;
    if (Icon) {
        return ((0, jsx_runtime_1.jsx)(Icon, { active: active, completed: completed, error: error, isSelected: isSelected, className: constants_1.stepperClassnames.stepIcon }));
    }
    if (completed && error && isSelected) {
        return (0, jsx_runtime_1.jsx)(styles_1.SelectIcon, { "$isError": true, className: constants_1.stepperClassnames.stepIcon });
    }
    if (completed && isSelected) {
        return (0, jsx_runtime_1.jsx)(styles_1.SelectIcon, { className: constants_1.stepperClassnames.stepIcon });
    }
    if (error) {
        return (0, jsx_runtime_1.jsx)(styles_1.ErrorIcon, { className: constants_1.stepperClassnames.stepIcon });
    }
    if (completed) {
        return (0, jsx_runtime_1.jsx)(styles_1.SuccessIcon, { className: constants_1.stepperClassnames.stepIcon });
    }
    if (active) {
        return (0, jsx_runtime_1.jsx)(styles_1.ActiveIcon, { className: constants_1.stepperClassnames.stepIcon });
    }
    return (0, jsx_runtime_1.jsx)(styles_1.DefaultIcon, { className: constants_1.stepperClassnames.stepIcon });
});
