export default function MessageContent()

in packages-fetcher/console-fetcher-risk-prompt/src/rc/message/message-content.tsx [136:192]


export default function MessageContent({
  noBg,
  message,
  iconType,
  isSmallIcon = false,
  showU2FRetryButton,
  onU2FErrorRetryClick
}: IMessageContentProps): JSX.Element {
  switch (iconType) {
    case EIconType.ERROR:
      return <ScError {...{
        align: 'center',
        justify: 'space-between',
        'data-no-bg': noBg
      }}>
        <ScMessageDiv>
          <ScIcon {...{
            type: EIconType.ERROR,
            'data-small-icon': isSmallIcon,
            'data-icon-type': EIconType.ERROR
          }} />
          {message}
        </ScMessageDiv>
        {/* 验证 U2F 场景,当 U2F 安全密钥获取失败时,有重试的按钮 */}
        {showU2FRetryButton && <Button {...{
          theme: ButtonTheme.TEXT_PRIMARY,
          size: ButtonSize.S,
          label: intl('op:retry'),
          onClick: onU2FErrorRetryClick
        }} />}
      </ScError>;
    case EIconType.NOTICE:
      return <ScNotice align="center">
        <ScIcon {...{
          type: EIconType.NOTICE,
          'data-icon-type': EIconType.NOTICE
        }} />
        {message}
      </ScNotice>;
    case EIconType.SUCCESS:
      return <ScSuccess align="center">
        <ScIcon {...{
          type: EIconType.SUCCESS,
          'data-icon-type': EIconType.SUCCESS
        }} />
        {message}
      </ScSuccess>;
    default:
      return <ScWarning align="center">
        <ScIcon {...{
          type: EIconType.WARNING,
          'data-icon-type': EIconType.WARNING
        }} />
        {message}
      </ScWarning>;
  }
}