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"> <

11 lines (10 loc) 838 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import classNames from 'classnames'; import { useTheme } from '../Flowbite/ThemeContext'; export const ListGroupItem = ({ active: isActive, children, href, icon: Icon, onClick, className, ...props }) => { const isLink = typeof href !== 'undefined'; const Component = isLink ? 'a' : 'button'; const theme = useTheme().theme.listGroup.item; const theirProps = props; return (_jsx("li", { children: _jsxs(Component, { className: classNames(theme.active[isActive ? 'on' : 'off'], theme.base, theme.href[isLink ? 'on' : 'off']), href: href, onClick: onClick, type: isLink ? undefined : 'button', ...theirProps, children: [Icon && _jsx(Icon, { "aria-hidden": true, className: theme.icon, "data-testid": "flowbite-list-group-item-icon" }), children] }) })); };