"use client"; import type { ComponentRenderProps } from "./types"; import { baseClass, getCustomClass } from "./utils"; export function Card({ element, children }: ComponentRenderProps) { const { props } = element; const customClass = getCustomClass(props); const maxWidthClass = props.maxWidth === "sm" ? "max-w-xs sm:min-w-[280px]" : props.maxWidth === "md" ? "max-w-sm sm:min-w-[320px]" : props.maxWidth === "lg" ? "max-w-md sm:min-w-[360px]" : "w-full"; const centeredClass = props.centered ? "mx-auto" : ""; return (
{props.title ? (
{props.title as string}
) : null} {props.description ? (
{props.description as string}
) : null}
{children}
); }