import { jsx as f } from "@emotion/react/jsx-runtime";
import { useState as m, useEffect as p } from "react";
import { useNetwork as u } from "@m4l/core";
import { OBJECT_LOGS_M4L_END_POINT as O, OBJECT_LOGS_OTHERS_END_POINT as c } from "../../constants.js";
import { ReactJsonViewer as _ } from "../../../extended/React-Json-Viewer/ReactJsonViewer.js";
function S(o) {
  const { logId: r, type: a } = o, { networkOperation: n } = u(), [s, i] = m({});
  return p(() => {
    let t = !0;
    return n({
      method: "GET",
      endPoint: `${a === "m4l" ? O : c}/${r}`
      // data: {
      //   ...(createdAt ? { created_at: createdAt } : {}),
      // },
    }).then((e) => {
      if (t) {
        const l = JSON.parse(String(e.data.log_detail));
        i(l);
      }
    }), function() {
      t = !1;
    };
  }, []), /* @__PURE__ */ f(
    _,
    {
      value: s,
      displayDataTypes: !1,
      quotesOnKeys: !1
    }
  );
}
export {
  S as DetailDialog
};
