import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  createDependenciesService
} from "./chunk-QLZSW3TK.js";
import "./chunk-I5KDLQBC.js";
import {
  useProjectModel
} from "./chunk-WFIBPVQL.js";
import {
  useVeloClient
} from "./chunk-ZY7YHRZR.js";
import "./chunk-DLEBD2WZ.js";
import "./chunk-RTNIG6ZW.js";
import "./chunk-O6HC4AYN.js";
import "./chunk-QRGKMYDD.js";
import "./chunk-RF4NA2OH.js";
import "./chunk-NMCF7XG5.js";
import "./chunk-MHV22UIU.js";
import "./chunk-WFQIXGJV.js";
import "./chunk-ECBO3UFC.js";
import "./chunk-YNEGRO3E.js";
import "./chunk-HWT3LUJJ.js";
import "./chunk-TOBTRYZF.js";
import {
  Trans
} from "./chunk-7WVNO7VU.js";
import "./chunk-RPTAJN5Y.js";
import {
  Alert,
  Badge,
  Spinner,
  Text,
  useAsync
} from "./chunk-YL4347CI.js";
import {
  require_react
} from "./chunk-TODKQSCF.js";
import "./chunk-AFPDHQYI.js";
import "./chunk-HYKBBZLS.js";
import "./chunk-C5RTKQVL.js";
import "./chunk-SVUXJRFD.js";
import "./chunk-YT5BPQDJ.js";
import "./chunk-LU3R3EBR.js";
import "./chunk-XZUGLEBK.js";
import "./chunk-VASURI4S.js";
import "./chunk-SDLCFZRL.js";
import {
  require_lib
} from "./chunk-MTT3QXBC.js";
import {
  __toESM,
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../cli-site/src/components/UninstallCommand/UninstallCommand.tsx
init_esm_shims();
var import_react = __toESM(require_react(), 1);
var import_variant = __toESM(require_lib(), 1);
var UninstallCommand = ({ packageName }) => {
  const { model } = useProjectModel();
  const veloClient = useVeloClient();
  const { status } = useAsync(async () => {
    const { projectFolder } = model;
    const service = await createDependenciesService(projectFolder, veloClient);
    await service.uninstall(packageName);
  }, []);
  return (0, import_variant.match)(status, {
    Loading: () => /* @__PURE__ */ import_react.default.createElement(
      Spinner,
      {
        text: /* @__PURE__ */ import_react.default.createElement(
          Trans,
          {
            i18nKey: "uninstall_command.loading",
            values: { packageName },
            components: [/* @__PURE__ */ import_react.default.createElement(Text, { bold: true })]
          }
        )
      }
    ),
    Error: () => null,
    Success: () => /* @__PURE__ */ import_react.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react.default.createElement(Badge, { skin: "success" }, /* @__PURE__ */ import_react.default.createElement(Trans, { i18nKey: "general.success" })), " ", /* @__PURE__ */ import_react.default.createElement(
      Trans,
      {
        i18nKey: "uninstall_command.success",
        values: { packageName },
        components: [/* @__PURE__ */ import_react.default.createElement(Text, { bold: true })]
      }
    ))
  });
};
export {
  UninstallCommand
};
//# sourceMappingURL=UninstallCommand-5UIR3NFF.js.map