import Link from "next/link"; import { classNames } from "@calcom/lib"; import { Icon, Badge, BadgeProps } from "../.."; import { Divider } from "../divider"; type Action = { check: () => boolean; fn: () => void }; export default function FormCard({ children, label, deleteField, moveUp, moveDown, className, badge, ...restProps }: { children: React.ReactNode; label?: React.ReactNode; deleteField?: Action | null; moveUp?: Action | null; moveDown?: Action | null; className?: string; badge?: { text: string; href?: string; variant: BadgeProps["variant"] } | null; } & JSX.IntrinsicElements["div"]) { className = classNames( className, "flex items-center group relative w-full rounded-md p-4 border border-gray-200" ); return (
{moveUp?.check() ? ( ) : null} {moveDown?.check() ? ( ) : null}
{label} {badge && ( {badge.href ? {badge.text} : badge.text} )}
{deleteField?.check() ? ( ) : null}
{children}
); }