import React, { DetailedHTMLProps, HTMLAttributes, ReactNode } from "react"; import classNames from "../lib/classNames"; import Typography from "../Typography"; import CardContent from "./CardContent"; export interface CustomCardProps { heading?: ReactNode; extra?: ReactNode; } export interface CardProps extends DetailedHTMLProps, HTMLDivElement>, CustomCardProps {} export function getCardStyles() { const cardStyles = { base: "bg-white overflow-hidden shadow rounded-lg divide-y divide-y-100", }; return classNames(cardStyles.base); } function Card({ children, className, heading, extra, ...rest }: CardProps) { return (
{(heading || extra) && ( {typeof heading === "string" ? ( {heading} ) : ( heading )} {extra} )} {children}
); } Card.Content = CardContent; export default Card;