@olleemilsson/flowbite-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"> <
10 lines (9 loc) • 818 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import classNames from 'classnames';
import { useTheme } from '../Flowbite/ThemeContext';
export const Card = ({ children, className, horizontal, href, imgAlt, imgSrc, ...props }) => {
const theme = useTheme().theme.card;
const Component = typeof href === 'undefined' ? 'div' : 'a';
const theirProps = props;
return (_jsxs(Component, { className: classNames(theme.base, theme.horizontal[horizontal ? 'on' : 'off'], href && theme.href, className), "data-testid": "flowbite-card", href: href, ...theirProps, children: [imgSrc && (_jsx("img", { alt: imgAlt ?? '', className: classNames(theme.img.base, theme.img.horizontal[horizontal ? 'on' : 'off']), src: imgSrc })), _jsx("div", { className: theme.children, children: children })] }));
};