import Link from "next/link"; import { inferQueryOutput } from "@calcom/trpc/react"; import { Switch } from "@calcom/ui/v2"; import OmniInstallAppButton from "@calcom/web/components/v2/apps/OmniInstallAppButton"; import { SetAppDataGeneric } from "../EventTypeAppContext"; import { eventTypeAppCardZod } from "../eventTypeAppCardZod"; export default function AppCard({ app, description, switchOnClick, switchChecked, children, setAppData, }: { app: inferQueryOutput<"viewer.apps">[number]; description?: React.ReactNode; switchChecked?: boolean; switchOnClick?: (e: boolean) => void; children?: React.ReactNode; setAppData: SetAppDataGeneric; }) { 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 ?
{children}
: null}
); }