pagamio-frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
16 lines (15 loc) • 1 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ExternalLinkIcon } from '@radix-ui/react-icons';
import { Card as FlowbiteCard } from 'flowbite-react';
const Card = ({ title, children, onOpenDetails, themeColor }) => {
const themeC = themeColor || 'rgb(180, 93, 174)';
return (_jsxs(FlowbiteCard, { className: "relative w-full sm:w-auto", style: {
borderBottom: `4px solid ${themeC}`,
height: '100%',
}, theme: {
root: {
children: 'p-3 gap-1',
},
}, children: [title && (_jsxs("div", { className: "mb-1 flex justify-between", children: [_jsx("h3", { className: "text-[15px] text-bold font-medium", children: title }), onOpenDetails && (_jsx("button", { onClick: onOpenDetails, className: "text-gray-500 hover:text-gray-700 focus:outline-none", "aria-label": "Open in new window", children: _jsx(ExternalLinkIcon, { className: "h-5 w-5" }) }))] })), children] }));
};
export default Card;