import { Component, ReactNode } from 'react'; import cx from 'classnames'; import Pop, { PopPositions } from '../pop'; import Icon from '../icon'; export interface IBlockHeaderProps { title: ReactNode; type?: 'ribbon' | 'minimum'; className?: string; tooltip?: ReactNode; position?: PopPositions; leftContent?: ReactNode; rightContent?: ReactNode; } export class BlockHeader extends Component { static defaultProps = { className: '', position: 'top-right', type: 'ribbon', }; private renderTitle() { const { title, type } = this.props; return (

{title}

); } private renderTooltip() { const { tooltip, position } = this.props; return (
{tooltip}
} > ); } private renderLeftContent() { const { leftContent } = this.props; return (
{leftContent}
); } private renderRightContent() { const { rightContent } = this.props; return (
{rightContent}
); } render() { const { leftContent, rightContent, tooltip, className, type } = this.props; return (
{this.renderTitle()} {tooltip && this.renderTooltip()} {leftContent && this.renderLeftContent()} {rightContent && this.renderRightContent()}
); } } export default BlockHeader;