import { jsx as i } from "@emotion/react/jsx-runtime";
import { useCallback as d } from "react";
import { useModuleDictionary as u, useEnvironment as f } from "@m4l/core";
import { useModal as g } from "../../../hooks/useModal/index.js";
import { useIsMobile as p } from "@m4l/graphics";
import { DICTIONARY as m } from "../dictionary.js";
import { WindowBaseStyled as I, StackStyled as L, DetailDialogComponent as _ } from "../slots/ObjectLogsSlots.js";
const S = (t) => {
  const { getLabel: e } = u(), { openModal: n, closeModal: s } = g(), { host_static_assets: l, environment_assets: r } = f(), c = p();
  return d(
    (a) => {
      let o;
      return t === "m4l" ? o = a.id : o = a.uuid, {
        iconUrl: `${l}/${r}/frontend/components/object_logs/assets/icons/search.svg`,
        tooltip: e(m.LABEL_LOG_DETAIL),
        dataTestId: `log-detail-${o}`,
        /**
         * Función que se ejecuta al hacer clic en el icono
         */
        onClick: () => {
          n({
            window: /* @__PURE__ */ i(
              I,
              {
                title: e(`${m.LABEL_LOG_DETAIL}`),
                onClose: s,
                variant: "outlined",
                emergeType: "modal",
                children: /* @__PURE__ */ i(L, { direction: "column", flexGrow: 1, children: /* @__PURE__ */ i(_, { logId: o, type: t }) })
              }
            ),
            fullScreen: c,
            initialWidth: 800,
            initialHeight: 600
          });
        }
      };
    },
    [t, l, r, e, n, s, c]
  );
};
export {
  S as useDetailFormatter
};
