import { jsx as _jsx } from "react/jsx-runtime";
import { memo } from 'react';
import { stepperClassnames } from '../constants';
import { ActiveIcon, DefaultIcon, ErrorIcon, SelectIcon, SuccessIcon, } from './styles';
export const StepIcon = memo((props) => {
    const { active, completed, error, isSelected, icon: Icon } = props;
    if (Icon) {
        return (_jsx(Icon, { active: active, completed: completed, error: error, isSelected: isSelected, className: stepperClassnames.stepIcon }));
    }
    if (completed && error && isSelected) {
        return _jsx(SelectIcon, { "$isError": true, className: stepperClassnames.stepIcon });
    }
    if (completed && isSelected) {
        return _jsx(SelectIcon, { className: stepperClassnames.stepIcon });
    }
    if (error) {
        return _jsx(ErrorIcon, { className: stepperClassnames.stepIcon });
    }
    if (completed) {
        return _jsx(SuccessIcon, { className: stepperClassnames.stepIcon });
    }
    if (active) {
        return _jsx(ActiveIcon, { className: stepperClassnames.stepIcon });
    }
    return _jsx(DefaultIcon, { className: stepperClassnames.stepIcon });
});
