UNPKG

@metamask/design-system-react

Version:
32 lines 1.8 kB
function $importDefault(module) { if (module?.__esModule) { return module.default; } return module; } import $React, { forwardRef } from "react"; const React = $importDefault($React); import { AvatarAccountVariant, AvatarAccountSize, AvatarBaseShape } from "../../types/index.mjs"; import { AvatarBase } from "../AvatarBase/index.mjs"; import { Blockies } from "../temp-components/Blockies/index.mjs"; import { Jazzicon } from "../temp-components/Jazzicon/index.mjs"; import { Maskicon } from "../temp-components/Maskicon/index.mjs"; import { MAP_AVATARACCOUNT_SIZE_SIZENUMBER } from "./AvatarAccount.constants.mjs"; export const AvatarAccount = forwardRef(({ address, variant = AvatarAccountVariant.Jazzicon, className, size = AvatarAccountSize.Md, blockiesProps, jazziconProps, maskiconProps, ...props }, ref) => { let AvatarArtComponent; switch (variant) { case AvatarAccountVariant.Blockies: AvatarArtComponent = (React.createElement(Blockies, { address: address, size: MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size], ...blockiesProps })); break; case AvatarAccountVariant.Maskicon: AvatarArtComponent = (React.createElement(Maskicon, { address: address, size: MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size], ...maskiconProps })); break; case AvatarAccountVariant.Jazzicon: default: AvatarArtComponent = (React.createElement(Jazzicon, { address: address, size: MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size], ...jazziconProps })); break; } return (React.createElement(AvatarBase, { ref: ref, shape: AvatarBaseShape.Square, size: size, className: className, ...props }, AvatarArtComponent)); }); AvatarAccount.displayName = 'AvatarAccount'; //# sourceMappingURL=AvatarAccount.mjs.map