import classNames from "classnames"; type Props = { header?: React.ReactNode; body?: React.ReactNode; footer?: React.ReactNode; align?: "center" | "left" | "right"; className?: string; interactive?: boolean; href?: string; padding?: "s" | "m" | "l"; highlight?: boolean; ungrouped?: boolean; }; export const VuiCard = ({ header, body, footer, align = "left", interactive, href, className, padding = "s", highlight, ungrouped, ...rest }: Props) => { const classes = classNames( "vuiCard", `vuiCard--${align}`, `vuiCard--${padding}`, { "vuiCard--interactive": interactive && !href, "vuiCard--link": href, "vuiCard--highlight": highlight, "vuiCard--ungrouped": ungrouped }, className ); const headerContent = header &&
{header}
; const bodyContent = body &&
{body}
; const footerContent = footer &&
{footer}
; if (href) { return ( {headerContent} {bodyContent} {footerContent} ); } return (
{headerContent} {bodyContent} {footerContent}
); };