@i-novus/ui-core
Version:
Базовые UI компоненты
12 lines (11 loc) • 570 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { Icon } from '../../../data-display/Icon';
export const ClearButton = forwardRef((props, ref) => {
const { clearIcon = true, disabled, onClick, visible, className, } = props;
if (disabled || !visible || !clearIcon) {
return null;
}
const icon = clearIcon === true ? _jsx(Icon, { icon: "common-close" }) : clearIcon.icon;
return (_jsx("button", { ref: ref, type: "button", className: className, onClick: onClick, tabIndex: 0, children: icon }));
});