UNPKG

@i-novus/ui-core

Version:

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

15 lines (14 loc) 811 B
import { jsx as _jsx } from "react/jsx-runtime"; import { forwardRef } from 'react'; import classNames from 'classnames'; import { useConfigProvider } from '../core'; import { Typography } from '../general/Typography'; export const Status = forwardRef((props, ref) => { const { color, label, to, className, prefix, style } = props; const { getPrefix } = useConfigProvider(); const prefixCls = getPrefix(prefix); return (_jsx("div", { ref: ref, className: classNames(`${prefixCls}-status`, className), style: { ...style, backgroundColor: color }, children: _jsx("span", { className: `${prefixCls}-status__content`, children: to ? _jsx(Typography.Link, { to: to, target: "_blank", fontSize: 12, children: label }) : label }) })); }); Status.displayName = 'Status';