import {
  AddCampaignPromotionForm
} from "./chunk-MNYDJXTM.js";
import "./chunk-KCYUY2AI.js";
import "./chunk-IQPN4PZJ.js";
import "./chunk-AEFDAU3Y.js";
import "./chunk-AW77UWCZ.js";
import "./chunk-TKGWSUEI.js";
import "./chunk-U2ZFCAPX.js";
import "./chunk-Y7QKP6QU.js";
import {
  RouteDrawer
} from "./chunk-FWJLS7XD.js";
import "./chunk-3QSRE5LS.js";
import {
  usePromotion
} from "./chunk-ZN7LWXVC.js";
import "./chunk-FXWKGNRV.js";
import "./chunk-VDKOJ5WD.js";
import "./chunk-RHKRREUU.js";
import "./chunk-ZA2KFUFR.js";
import "./chunk-ZBWL72TB.js";
import "./chunk-NBMM2TZK.js";

// src/pages/promotions/promotion-add-campaign/promotion-add-campaign.tsx
import { Heading } from "@medusajs/ui";
import { useTranslation } from "react-i18next";
import { useParams } from "react-router-dom";
import { jsx, jsxs } from "react/jsx-runtime";
var PromotionAddCampaign = () => {
  const { id } = useParams();
  const { t } = useTranslation();
  const { promotion, isPending, isError, error } = usePromotion(id);
  if (isError) {
    throw error;
  }
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
    /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(Heading, { children: t("promotions.campaign.edit.header") }) }),
    !isPending && promotion && /* @__PURE__ */ jsx(AddCampaignPromotionForm, { promotion })
  ] });
};
export {
  PromotionAddCampaign as Component
};
