"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const components_1 = require("@bluebase/components");
const Avatar_1 = tslib_1.__importDefault(require("@material-ui/core/Avatar"));
const react_1 = tslib_1.__importDefault(require("react"));
exports.Avatar = (props) => {
    const { type, icon, color, size, image, text } = props, rest = tslib_1.__rest(props, ["type", "icon", "color", "size", "image", "text"]);
    if (type === 'icon') {
        return (react_1.default.createElement(Avatar_1.default, Object.assign({}, rest),
            react_1.default.createElement(components_1.Icon, { name: icon, color: color })));
    }
    if (type === 'image') {
        return (react_1.default.createElement(Avatar_1.default, null,
            react_1.default.createElement(components_1.BlueBaseImage, { source: image, style: [{ height: size, width: size }, props.style] })));
    }
    return (react_1.default.createElement(Avatar_1.default, Object.assign({}, rest), text));
};
exports.Avatar.defaultProps = components_1.AvatarDefaultProps;
