22 lines
338 B
TypeScript
22 lines
338 B
TypeScript
import type { ElementType, ReactNode } from "react";
|
|
|
|
interface CardProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
as?: ElementType;
|
|
}
|
|
|
|
export function Card({
|
|
children,
|
|
className = "",
|
|
as: Tag = "div",
|
|
}: CardProps) {
|
|
return (
|
|
<Tag
|
|
className={`card ${className}`.trim()}
|
|
>
|
|
{children}
|
|
</Tag>
|
|
);
|
|
}
|