UNPKG

@lunit/oui

Version:

Lunit Oncology UI components

15 lines (14 loc) 789 B
import { jsx as _jsx } from "react/jsx-runtime"; import { forwardRef } from 'react'; import { Close } from '../../icons'; import BaseAlert from './Alert.styled'; import { getAccentColor, getIcons } from './Alert.utils'; import { Button } from '../Button'; const Alert = forwardRef(({ title, severity, children, onClose, ...rest }, ref) => { return (_jsx("div", { ref: ref, children: _jsx(BaseAlert, { severity: severity, icon: getIcons(severity), slots: { closeButton: () => (_jsx(Button, { variant: "ghost", icon: _jsx(Close, { fontSize: "small" }), onClick: onClose, size: "small", sx: { color: getAccentColor(severity), } })), }, onClose: onClose, ...rest, children: children }) })); }); export default Alert;