@zohodesk/dot
Version:
In this Library, we Provide Some Basic Components to Build Your Application
48 lines • 1.44 kB
JavaScript
import React from 'react';
import { defaultProps } from "./props/defaultProps";
import { propTypes } from "./props/propTypes";
import { Icon } from '@zohodesk/icons';
import { Container } from '@zohodesk/components/es/v1/Layout';
import AvatarSize from '@zohodesk/components/es/Provider/AvatarSize';
import style from "../../../avatar/AvatarIcon/AvatarIcon.module.css";
export default function AvatarIcon(props) {
let {
name,
size,
iconSize,
iconClass,
iconColor,
onClick,
palette,
dataId,
className,
isIconBold,
title,
borderOnActive,
borderOnHover,
customProps,
dataSelectorId
} = props;
let {
AvatarIconProps = {}
} = customProps;
let border = borderOnHover || onClick;
return /*#__PURE__*/React.createElement(Container, {
className: `${style.container} ${borderOnActive ? style.borderOnActive : border ? style.borderOnHover : ''} ${AvatarSize(size)} ${style[palette]} ${className}`,
onClick: onClick,
dataId: dataId,
"data-title": title,
isInline: true,
align: "both",
isCover: false,
dataSelectorId: dataSelectorId,
...AvatarIconProps
}, /*#__PURE__*/React.createElement(Icon, {
name: name,
size: iconSize,
iconClass: ` ${iconClass} ${style.iconColor} ${iconColor ? ` ${style[`icon_${iconColor}`]}` : ''} `,
isBold: isIconBold
}));
}
AvatarIcon.defaultProps = defaultProps;
AvatarIcon.propTypes = propTypes;