UNPKG

@i-novus/ui-core

Version:

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

11 lines (10 loc) 979 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import classNames from 'classnames'; import { useConfigProvider } from '../../core'; import { Button } from '../../general/Button'; export const Footer = ({ prefix, className, children, onCancel, onOk, okVariant = 'link', cancelVariant = 'link', okText = 'Применить', cancelText = 'Отменить', disabled = false, ...rest }) => { const { getPrefix } = useConfigProvider(); const prefixCls = getPrefix(prefix); return (_jsxs("div", { className: classNames(`${prefixCls}-popover-footer`, className), ...rest, children: [children, (onCancel || onOk) && (_jsxs("div", { className: `${prefixCls}-popover-actions`, children: [onCancel && (_jsx(Button, { variant: cancelVariant, onClick: onCancel, disabled: disabled, children: cancelText })), onOk && (_jsx(Button, { variant: okVariant, disabled: disabled, onClick: onOk, children: okText }))] }))] })); }; Footer.displayName = 'PopoverFooter';