import { jsx as m } from "@emotion/react/jsx-runtime";
import { useCallback as l } from "react";
import { useModuleDictionary as d, useHostTools as c, EmitEvents as T } from "@m4l/core";
import { ActionsDownloadOutlined as p } from "@m4l/icons";
import { DICTIONARY as r } from "../../../../dictionary.js";
import { IconButton as u } from "../../../../../extended/mui/IconButton/IconButton.js";
import { useDataGrid as E } from "../../../../hooks/shared/useDataGrid/useDataGrid.js";
function f({ exportConfig: o }) {
  const { getLabel: t } = d(), { events_emit: i } = c(), { size: e } = E(), n = l(() => {
    const a = o.getDynamicParams?.() ?? {}, s = {
      winType: "microfrontend",
      emergeType: "modal",
      moduleId: o.moduleId,
      mfProps: o.mfProps,
      dynamicParams: a,
      title: o.title,
      iconUrl: o.iconUrl ?? "",
      modalProps: o.modalProps ?? {
        width: 600,
        height: 400,
        minWindowWidth: 400,
        minWindowHeight: 300
      }
    };
    i(T.EMMIT_EVENT_HOST_EMERGE_WINDOW, s);
  }, [o, i]);
  return /* @__PURE__ */ m(
    u,
    {
      size: e,
      icon: /* @__PURE__ */ m(p, {}),
      tooltip: t(r.TOOLTIP_EXPORT),
      onClick: n,
      "aria-label": t(r.TOOLTIP_EXPORT),
      dataTestId: "export-icon"
    }
  );
}
export {
  f as Export
};
