import * as tslib_1 from "tslib";
/* tslint:disable */
import * as React from 'react';
/* tslint:enable */
import { IconType } from './Icon.types';
import { Image } from '../Image/Image';
import { css, getNativeProps, htmlElementProperties } from '../../Utilities';
import { getIcon } from '../../Styling';
import { getClassNames } from './Icon.classNames';
export var Icon = function (props) {
    var ariaLabel = props.ariaLabel, className = props.className, styles = props.styles, iconName = props.iconName;
    var classNames = getClassNames(styles);
    if (props.iconType === IconType.image || props.iconType === IconType.Image) {
        var containerClassName = css('ms-Icon-imageContainer', classNames.root, classNames.imageContainer, className);
        return (React.createElement("div", { className: css(containerClassName, classNames.root) },
            React.createElement(Image, tslib_1.__assign({}, props.imageProps))));
    }
    else if (typeof iconName === 'string' && iconName.length === 0) {
        return (React.createElement("i", tslib_1.__assign({ "aria-label": ariaLabel }, (ariaLabel ? {} : {
            role: 'presentation',
            'aria-hidden': true
        }), getNativeProps(props, htmlElementProperties), { className: css('ms-Icon-placeHolder', classNames.rootHasPlaceHolder, props.className) })));
    }
    else {
        var iconDefinition = getIcon(iconName) || {
            subset: {
                className: undefined
            },
            code: undefined
        };
        return (React.createElement("i", tslib_1.__assign({ "aria-label": ariaLabel }, (ariaLabel ? {} : {
            role: 'presentation',
            'aria-hidden': true,
            'data-icon-name': iconName,
        }), getNativeProps(props, htmlElementProperties), { className: css(iconDefinition.subset.className, classNames.root, props.className) }), iconDefinition.code));
    }
};
//# sourceMappingURL=Icon.js.map