import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import { Separator } from "@/components/ui/separator"; import { cn } from "@/lib/utils"; import { type VariantProps, cva } from "class-variance-authority"; // py-0 const formCardVariants = cva( "group relative w-full overflow-hidden py-0 shadow-none gap-4", { variants: { variant: { default: "", destructive: "border-destructive", info: "border-info", }, defaultVariants: { variant: "default", }, }, }, ); // NOTE: Add a formcardprovider to share the variant prop export function FormCard({ children, className, variant, ...props }: React.ComponentProps<"div"> & VariantProps) { return ( {children} ); } export function FormCardHeader({ children, className, ...props }: React.ComponentProps<"div">) { return ( {children} ); } export function FormCardTitle({ children }: { children: React.ReactNode }) { return {children}; } export function FormCardDescription({ children, }: { children: React.ReactNode; }) { return {children}; } export function FormCardContent({ children, className, ...props }: React.ComponentProps<"div">) { return ( {children} ); } export function FormCardSeparator({ ...props }: React.ComponentProps) { return ; } const formCardFooterVariants = cva( "border-t flex items-center gap-2 pb-4 px-4 [&>:last-child]:ml-auto [.border-t]:pt-4", { variants: { variant: { default: "", destructive: "border-destructive bg-destructive/5", info: "border-info bg-info/5", }, defaultVariants: { variant: "default", }, }, }, ); export function FormCardFooter({ children, className, variant, ...props }: React.ComponentProps<"div"> & VariantProps) { return ( {children} ); } export function FormCardFooterInfo({ children, className, ...props }: React.ComponentProps<"div">) { return (
{children}
); } export function FormCardGroup({ children, className, ...props }: React.ComponentProps<"div">) { return (
{children}
); } export function FormCardUpgrade({ children, className, ...props }: React.ComponentProps<"div">) { return (
{children}
); } // NOTE; this is for a very specific case where we don't want to disable the whole content // and instead disable specpfic card content (e.g. for add-ons) export function FormCardContentUpgrade({ children, className, ...props }: React.ComponentProps<"div">) { return (
{children}
); } export function FormCardEmpty({ children, className, ...props }: React.ComponentProps<"div">) { return (
{children}
); }