import Button from '../button'; import ConfigProvider from '../config-provider'; import React, { Component } from 'react'; import cls from 'classnames'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { Balloon as NextBalloon } from '@alifd/next'; import { BalloonProps as NextBalloonProps } from '@alifd/next/types/balloon'; interface BalloonProps extends Omit< NextBalloonProps, 'type' | 'linkProps' | 'buttonProps' | 'onButtonClick' > { type?: 'normal' | 'dark' | 'primary'; linkProps?: string[]; buttonProps?: string; onButtonClick?: () => void; } class Balloon extends Component { static Tooltip = NextBalloon.Tooltip; render() { const { prefix = 'next-', type = 'normal', title, children, closable, linkProps, buttonProps, onButtonClick, ...otherProps } = this.props; if (!linkProps && !buttonProps && !onButtonClick) { return ( ); } return (
{children}
{linkProps ? linkProps[1] : undefined}
); } } hoistNonReactStatics(Balloon, NextBalloon); export default ConfigProvider.config(Balloon);