Files
site/src/components/ui/card.tsx
2026-03-15 22:47:27 +01:00

28 lines
720 B
TypeScript

import { cn } from "@/lib/utils";
import { type HTMLAttributes, forwardRef } from "react";
interface CardProps extends HTMLAttributes<HTMLDivElement> {
hoverable?: boolean;
}
const Card = forwardRef<HTMLDivElement, CardProps>(
({ className, hoverable = false, children, ...props }, ref) => {
return (
<div
ref={ref}
className={cn(
"bg-surface-card border border-surface-border rounded-[var(--radius-lg)] p-6",
hoverable && "transition-all hover:bg-surface-card-hover hover:shadow-[var(--shadow-glow)]",
className
)}
{...props}
>
{children}
</div>
);
}
);
Card.displayName = "Card";
export { Card, type CardProps };