Hkoradiya123
Initial commit
5463318
Raw History Blame Contribute Delete
1.9 kB
import React from "react";
import { cn } from "../../utils/cn";
import { motion } from "framer-motion";
export const Card = React.forwardRef(
({ className, variant = "default", hoverEffect = false, children, ...props }, ref) => {
const variants = {
default: "bg-card text-card-foreground border-border border",
glass: "glass text-foreground",
glow: "bg-card text-card-foreground border-border border hover:shadow-[0_0_15px_rgba(var(--primary),0.2)] transition-shadow duration-300",
};
const Wrapper = hoverEffect ? motion.div : "div";
const wrapperProps = hoverEffect ? { whileHover: { y: -4 } } : {};
return (
<Wrapper
ref={ref}
{...wrapperProps}
className={cn(
"rounded-xl overflow-hidden",
variants[variant],
className
)}
{...props}
>
{children}
</Wrapper>
);
}
);
Card.displayName = "Card";
export function CardHeader({ className, ...props }) {
return <div className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} />;
}
export function CardTitle({ className, ...props }) {
return (
<h3
className={cn("text-2xl font-semibold leading-none tracking-tight", className)}
{...props}
/>
);
}
export function CardDescription({ className, ...props }) {
return (
<p className={cn("text-sm text-muted-foreground", className)} {...props} />
);
}
export function CardContent({ className, ...props }) {
return <div className={cn("p-6 pt-0", className)} {...props} />;
}
export function CardFooter({ className, ...props }) {
return (
<div className={cn("flex items-center p-6 pt-0", className)} {...props} />
);
}