"use client";
import { cn } from "@/shared/utils/cn";
export default function Card({
children,
title,
subtitle,
icon,
action,
padding = "md",
hover = false,
className,
...props
}) {
const paddings = {
none: "",
xs: "p-3",
sm: "p-4",
md: "p-6",
lg: "p-8",
};
return (
{(title || action) && (
{icon && (
{icon}
)}
{title && (
{title}
)}
{subtitle && (
{subtitle}
)}
{action}
)}
{children}
);
}
// Sub-component: Bordered section inside Card
Card.Section = function CardSection({ children, className, ...props }) {
return (
{children}
);
};
// Sub-component: Hoverable row inside Card
Card.Row = function CardRow({ children, className, ...props }) {
return (
{children}
);
};
// Sub-component: List item with hover actions (macOS style)
Card.ListItem = function CardListItem({
children,
actions,
className,
...props
}) {
return (
{children}
{actions && (
{actions}
)}
);
};