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) • 815 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import classNames from 'classnames';
import { useTheme } from '../Flowbite/ThemeContext';
export const Badge = ({ children, color = 'info', href, icon: Icon, size = 'xs', className, ...props }) => {
const theme = useTheme().theme.badge;
const Content = () => (_jsxs("span", { className: classNames(theme.base, theme.color[color], theme.icon[Icon ? 'on' : 'off'], theme.size[size], className), "data-testid": "flowbite-badge", ...props, children: [Icon && _jsx(Icon, { "aria-hidden": true, className: theme.icon.size[size], "data-testid": "flowbite-badge-icon" }), children && _jsx("span", { children: children })] }));
return href ? (_jsx("a", { className: theme.href, href: href, children: _jsx(Content, {}) })) : (_jsx(Content, {}));
};