import { jsx } from "react/jsx-runtime";
import { Entity } from "@contember/binding";
import { Grid } from "@contember/ui";
import { useClassName } from "@contember/utilities";
import { memo } from "react";
import { dataGridDictionary } from "../dataGridDictionary.js";
import { useMessageFormatter } from "../../../../../../i18n/useMessageFormatter.js";
import { EmptyMessage } from "../../../helpers/EmptyMessage.js";
const DataGridContainerGrid = memo(({
  accessor,
  emptyMessage,
  emptyMessageComponent,
  tile,
  tileSize = 160
}) => {
  const formatMessage = useMessageFormatter(dataGridDictionary);
  return /* @__PURE__ */ jsx("div", { className: useClassName("data-grid-body-content-grid"), children: /* @__PURE__ */ jsx(Grid, { columnWidth: tileSize, children: !!accessor.length ? Array.from(accessor, (entity) => /* @__PURE__ */ jsx(Entity, { accessor: entity, children: tile }, entity.id)) : /* @__PURE__ */ jsx(EmptyMessage, { component: emptyMessageComponent, className: "cui-grid-row-full-width", children: formatMessage(emptyMessage, "dataGrid.emptyMessage.text") }) }) });
});
DataGridContainerGrid.displayName = "DataGridContainerGrid";
export {
  DataGridContainerGrid
};
//# sourceMappingURL=DataGridContainerGrid.js.map
