import { useAutoAnimate } from "@formkit/auto-animate/react"; import Link from "next/link"; import { RouterOutputs } from "@calcom/trpc/react"; import { Switch } from "@calcom/ui"; import { SetAppDataGeneric } from "../EventTypeAppContext"; import { eventTypeAppCardZod } from "../eventTypeAppCardZod"; import OmniInstallAppButton from "./OmniInstallAppButton"; export default function AppCard({ app, description, switchOnClick, switchChecked, children, setAppData, }: { app: RouterOutputs["viewer"]["apps"][number]; description?: React.ReactNode; switchChecked?: boolean; switchOnClick?: (e: boolean) => void; children?: React.ReactNode; setAppData: SetAppDataGeneric; }) { const [animationRef] = useAutoAnimate(); return (
{/* Don't know why but w-[42px] isn't working, started happening when I started using next/dynamic */} {app?.name}
{app?.name}

{description || app?.description}

{app?.isInstalled ? (
{ if (switchOnClick) { switchOnClick(enabled); } setAppData("enabled", enabled); }} checked={switchChecked} />
) : ( )}
{app?.isInstalled && switchChecked &&
} {app?.isInstalled && switchChecked ?
{children}
: null}
); }