UNPKG

@dynamic-labs/sdk-react-core

Version:

A React SDK for implementing wallet web3 authentication and authorization to your website.

27 lines (24 loc) 1.25 kB
'use client' import { jsx, jsxs } from 'react/jsx-runtime'; import '@dynamic-labs/sdk-api-core'; import '../../shared/logger.js'; import '@dynamic-labs/iconic'; import '@dynamic-labs/wallet-connector-core'; import 'react'; import { ReactComponent as SvgError } from '../../shared/assets/error.js'; import '../../context/ViewContext/ViewContext.js'; import '@dynamic-labs/wallet-book'; import '@dynamic-labs/utils'; import '../../utils/constants/colors.js'; import '../../utils/constants/values.js'; import '../../shared/consts/index.js'; import { classNames } from '../../utils/functions/classNames/classNames.js'; import { Icon } from '../Icon/Icon.js'; import { AlertText } from './AlertText/AlertText.js'; const errorIconMap = { error: jsx(SvgError, {}), }; const Alert = ({ children, icon, variant = 'error', contentDataTestId, className = '', }) => (jsxs("div", { className: classNames('alert', `alert--${variant}`, className, { 'alert--with-icon': Boolean(icon), }), children: [icon && (jsx(Icon, { size: 'small', className: 'alert__icon', children: typeof icon === 'string' ? errorIconMap[icon] : icon })), jsx(AlertText, { content: children, contentDataTestId: contentDataTestId })] })); export { Alert, errorIconMap };