UNPKG

hoda-react

Version:

<div align="center"> <h1>:construction: flowbite-react (unreleased) :construction:</h1> <p> <a href="https://flowbite-react.com"> <img alt="Flowbite - Tailwind CSS components" width="350" src=".github/assets/flowbite-react-github.png"> <

9 lines (8 loc) 1.06 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import classNames from 'classnames'; import { HiX } from 'react-icons/hi'; import { useTheme } from '../Flowbite/ThemeContext'; export const Alert = ({ additionalContent, children, color = 'info', icon: Icon, onDismiss, rounded = true, withBorderAccent, className, }) => { const theme = useTheme().theme.alert; return (_jsxs("div", { className: classNames(theme.base, theme.color[color], rounded && theme.rounded, withBorderAccent && theme.borderAccent, className), role: "alert", children: [_jsxs("div", { className: theme.wrapper, children: [Icon && _jsx(Icon, { className: theme.icon }), _jsx("div", { children: children }), typeof onDismiss === 'function' && (_jsx("button", { "aria-label": "Dismiss", className: classNames(theme.closeButton.base, theme.closeButton.color[color]), onClick: onDismiss, type: "button", children: _jsx(HiX, { "aria-hidden": true, className: theme.closeButton.icon }) }))] }), additionalContent && _jsx("div", { children: additionalContent })] })); };