UNPKG

@i-novus/ui-core

Version:

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

9 lines (8 loc) 910 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import classNames from 'classnames'; import { useConfigProvider } from '../core'; export const Alert = ({ title, text, className, style, prefixIcon, prefix, children, closeButton, onClick, }) => { const { getPrefix } = useConfigProvider(); const prefixCls = getPrefix(prefix); return (_jsxs("div", { role: "presentation", className: classNames(`${prefixCls}-alert`, className), style: style, onClick: onClick, children: [prefixIcon, (text || title) && (_jsxs("div", { className: `${prefixCls}-alert__content`, children: [title && (_jsx("span", { className: classNames(`${prefixCls}-alert__title`), children: title })), text && (_jsx("span", { className: classNames(`${prefixCls}-alert__text`), children: text }))] })), children, closeButton && (_jsx("div", { className: `${prefixCls}-alert__close`, children: closeButton }))] })); };