UNPKG

@atlaskit/avatar

Version:

An avatar is a visual representation of a user or entity.

52 lines 1.52 kB
/* status-wrapper.tsx generated by @compiled/babel-plugin v0.39.1 */ import "./status-wrapper.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import AvatarStatus from '../status'; const styles = { root: "_kqswstnw" }; const iconSizeMap = { small: "_4t3i1crf _1bsb1crf", medium: "_4t3idlk8 _1bsbdlk8", large: "_4t3io7ao _1bsbo7ao", xlarge: "_4t3if6fq _1bsbf6fq" }; const circleIconOffsetMap = { small: "_rjxpidpf _152tidpf", medium: "_rjxpidpf _152tidpf", large: "_rjxpt94y _152tt94y", xlarge: "_rjxp1v6z _152t1v6z" }; const squareIconOffsetMap = { root: "_rjxpidpf _152tidpf" }; const hexagonIconOffsetMap = { small: "_rjxp1n1a _152t1n1a", medium: "_rjxp1n1a _152t1n1a", large: "_rjxpmyb0 _152t1y44", xlarge: "_rjxp1lpd _152tl52n" }; /** * __Status wrapper__ * * A status wrapper is used internally to position status on top of the avatar. */ const StatusWrapper = ({ size, status, appearance, borderColor, children, testId }) => { return /*#__PURE__*/React.createElement("span", { "aria-hidden": "true", "data-testid": testId && `${testId}--status`, className: ax([styles.root, iconSizeMap[size], circleIconOffsetMap[size], appearance === 'square' && squareIconOffsetMap.root, appearance === 'hexagon' && hexagonIconOffsetMap[size]]) }, /*#__PURE__*/React.createElement(AvatarStatus, { borderColor: borderColor, status: !children ? status : undefined }, children)); }; export default StatusWrapper;