import { jsx as r } from "@emotion/react/jsx-runtime";
import { useState as O, useEffect as _ } from "react";
import { TEST_PROP_ID as P } from "../../../../test/constants_no_mock.js";
import { ContainerWrapperStyled as T, GridWrapperStyled as g } from "../../slots/ObjectLogsSlots.js";
import { useRows as h } from "@m4l/graphics";
import { useObjectLogsColumns as C } from "../../hooks/useObjectLogsColumns.js";
import { OBJECT_LOGS_OTHERS_END_POINT as S, OBJECT_LOGS_KEY_COMPONENT as E } from "../../constants.js";
import { getPropDataTestId as y } from "../../../../test/getNameDataTestId.js";
import { useFilterAndSort as b } from "../../hooks/useFilterAndSort.js";
import { DataGrid as w } from "../../../datagrids/components/DataGridMain/DataGridMain.js";
import { ObjectLogsSlots as L } from "../../slots/ObjectLogsEnum.js";
function v(s) {
  const { dataTestId: e = "", resourceSerialId: o, resourceTypeId: t } = s, [a, i] = O({}), m = C("other"), { rows: n, clearRows: l, refresh: c } = h({
    endPoint: S,
    fireOnFirstLoad: !1,
    fireOnChangeParms: !1,
    queryParams: a,
    bodyToSnakeCase: !0,
    responseToCamelCase: !0
  });
  _(() => {
    l();
  }, [o, t]);
  const { leftActions: d, visibleCustomHeader: p, customHeaderComponent: u } = b({ setBackendQueryParams: i, Refresh: c, otherApp: !0, resourceTypeId: t, resourceSerialId: o });
  return /* @__PURE__ */ r(
    T,
    {
      ...process.env.NODE_ENV !== "production" ? { [P]: `m4ldatagrids-${e}` } : {},
      ...y(E, L.root, e),
      role: "grid",
      "aria-label": "object-logs",
      children: /* @__PURE__ */ r(
        g,
        {
          children: /* @__PURE__ */ r(
            w,
            {
              id: "users_logs_list",
              dataTestId: e,
              columns: m,
              rows: n,
              rowKeyGetter: (f) => f.id,
              withActions: !0,
              visibleCustomHeader: p,
              customHeader: u,
              actionsProps: {
                leftActions: d,
                withPager: !1,
                withLocalFilters: !1
              }
            },
            "users_list_logs"
          )
        }
      )
    }
  );
}
export {
  v as ObjectLogsByOthers
};
