// VD-MCP Interim-UI (AD-28) — "Mit KI verbinden" as a shell dialog, modelled on
// the Subframe "Connect to code" modal: one accordion per client, each step a
// copyable command or URL. Presentational only: the shell injects the VM and the
// revoke callback, so there is no useLoaderData/useFetcher in here (DoD A.5).
// Final Subframe optics land as a tracked design-nachzug.
import { useTranslation } from "react-i18next";
import { FeatherX } from "@subframe/core";
import type { McpClientGuideVM, McpConnectionVM, McpConnectVM } from "@hivegrid/view-models";
import { Accordion } from "~/ui/components/Accordion";
import { Button } from "~/ui/components/Button";
import { CopyToClipboardButton } from "~/ui/components/CopyToClipboardButton";
import { Dialog } from "~/ui/components/Dialog";
import { IconButton } from "~/ui/components/IconButton";
import { useLocaleFormatters } from "~/locale/format";
import { ClientIcon } from "./ClientIcon";
export type McpConnectDialogProps = {
open: boolean;
onOpenChange: (open: boolean) => void;
vm: McpConnectVM;
/** Cuts one client's tokens; the shell reloads the VM afterwards. */
onRevoke: (clientId: string) => void;
/** Client id currently being revoked, for the pending button state. */
revokingClientId?: string | null;
};
export function McpConnectDialog({ open, onOpenChange, vm, onRevoke, revokingClientId = null }: McpConnectDialogProps) {
const { t } = useTranslation();
return (
);
}
function GuideAccordion({ guide }: { guide: McpClientGuideVM }) {
const { t } = useTranslation();
return (
{t(guide.labelKey)}
}
>