"use client"; import type { RefObject } from "react"; import { Trans, useTranslation } from "react-i18next"; import { ActionConfirmPopover } from "@/components/confirmation/action-confirm-popover"; import { InlineConfirmActions } from "@/components/confirmation/inline-confirm-actions"; import { MobileActionConfirmation } from "@/components/confirmation/mobile-action-confirmation"; import type { PluginRecord } from "@/lib/types/plugins"; type UninstallPluginConfirmationProps = { target: PluginRecord; open: boolean; isFinePointer: boolean; anchorRef: RefObject; onOpenChange: (open: boolean) => void; onCancel: () => void; onConfirm: () => void | Promise; }; /** * Keeps plugin uninstall confirmation at its initiating control. The action * hook still owns the target mutation, pending state, and failure feedback. */ export function PluginUninstallConfirmation({ target, open, isFinePointer, anchorRef, onOpenChange, onCancel, onConfirm, }: UninstallPluginConfirmationProps) { const { t } = useTranslation(); const description = ( This will permanently remove{" "} {target.display_name} and revoke its API key. This action cannot be undone. ); const confirmAriaLabel = t("plugins:confirmUninstall"); const fallback = !isFinePointer ? ( onOpenChange(false)} onConfirm={onConfirm} /> ) : ( ); return ( ); }