2023-06-15 12:52:46 +03:00
|
|
|
/* eslint-disable */
|
2023-05-23 13:45:10 +03:00
|
|
|
"use client";
|
2023-05-22 20:54:07 +03:00
|
|
|
import { motion } from "framer-motion";
|
2023-06-15 12:52:46 +03:00
|
|
|
import { forwardRef, HTMLAttributes, LegacyRef } from "react";
|
|
|
|
|
|
|
|
import { cn } from "@/lib/utils";
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-05-26 14:56:29 +03:00
|
|
|
type CardProps = HTMLAttributes<HTMLDivElement>;
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-06-15 12:52:46 +03:00
|
|
|
const Card = forwardRef(
|
|
|
|
({ children, className, ...props }: CardProps, ref): JSX.Element => {
|
2023-05-22 20:54:07 +03:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
ref={ref as LegacyRef<HTMLDivElement>}
|
|
|
|
className={cn(
|
|
|
|
"shadow-md dark:shadow-primary/25 hover:shadow-xl transition-shadow rounded-xl overflow-hidden bg-white dark:bg-black border border-black/10 dark:border-white/25",
|
|
|
|
className
|
|
|
|
)}
|
|
|
|
{...props}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-10-05 18:50:02 +03:00
|
|
|
type CardChildProps = HTMLAttributes<HTMLDivElement>;
|
|
|
|
|
|
|
|
const CardHeader = ({ children, className }: CardChildProps) => {
|
|
|
|
return <div className={cn("border-b p-3", className)}>{children}</div>;
|
|
|
|
};
|
|
|
|
CardHeader.displayName = "CardHeader";
|
|
|
|
|
|
|
|
const CardBody = ({ children, className }: CardChildProps) => {
|
|
|
|
return <div className={cn("p-3", className)}>{children}</div>;
|
|
|
|
};
|
|
|
|
CardBody.displayName = "CardHeader";
|
|
|
|
|
|
|
|
const CardFooter = ({ children, className }: CardChildProps) => {
|
|
|
|
return <div className={cn("border-t p-3", className)}>{children}</div>;
|
|
|
|
};
|
|
|
|
CardFooter.displayName = "CardHeader";
|
|
|
|
|
|
|
|
export { CardBody, CardFooter, CardHeader };
|
|
|
|
|
2023-05-22 20:54:07 +03:00
|
|
|
export const AnimatedCard = motion(Card);
|
2023-05-22 21:08:15 +03:00
|
|
|
AnimatedCard.displayName = "AnimatedCard";
|
2023-05-22 21:11:33 +03:00
|
|
|
Card.displayName = "Card";
|
2023-05-21 02:20:55 +03:00
|
|
|
export default Card;
|