"use client"; import Link from "next/link"; import { useState } from "react"; import { classNames } from "@calcom/lib"; import type { BadgeProps } from "../badge"; import { Badge } from "../badge"; import { Divider } from "../divider"; import { Input } from "../form/inputs/TextField"; import { Icon } from "../icon"; type Action = { check: () => boolean; fn: () => void }; export default function FormCard({ children, label, isLabelEditable, onLabelChange, deleteField, moveUp, moveDown, className, badge, ...restProps }: { children: React.ReactNode; label: string; isLabelEditable?: boolean; onLabelChange?: (label: string) => void; 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-subtle" ); const [isCollapsed, setIsCollapsed] = useState(false); const toggleFormCard = () => { setIsCollapsed((prev) => !prev); }; return (