28 lines
720 B
TypeScript
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 };
|