UNPKG

@i-novus/ui-core

Version:

Базовые UI компоненты

11 lines (10 loc) 880 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import classNames from 'classnames'; import { useConfigProvider } from '../../core'; import { Icon } from '../Icon'; export const Header = ({ prefix, onClick, onClose, className, children, style, showCloseButton = false, underline = false, }) => { const { getPrefix } = useConfigProvider(); const prefixCls = `${getPrefix(prefix)}-popover`; return (_jsxs("div", { onClick: onClick, style: style, className: classNames(`${prefixCls}-header`, className, underline && `${prefixCls}-header-underline`), children: [children && _jsx("span", { className: `${prefixCls}-header-content`, children: children }), showCloseButton && (_jsx("button", { type: "button", className: `${prefixCls}-close`, onClick: onClose, children: _jsx(Icon, { icon: "common-close" }) }))] })); }; Header.displayName = 'PopoverHeader';