import { jsx as r } from "@emotion/react/jsx-runtime";
import { useState as f } from "react";
import { TableView as E } from "../../views/TableView/TableView.js";
import { BaseDataGrid as R } from "../BaseDataGrid/BaseDataGrid.js";
function D(e) {
  const {
    id: s,
    withActions: t,
    columns: a,
    rows: p,
    selectedRows: c,
    onSelectedRowsChange: u,
    rowKeyGetter: i,
    onRowsChange: G,
    focusOnRowKey: l,
    smoothScroll: w,
    checkedRows: h,
    onCheckedRowsChange: x,
    rowGrouper: I,
    expandedGroupIds: o,
    onExpandedGroupIdsChange: n,
    rowCellsBackground: m
  } = e, [C, g] = f(() => new Set(o ?? [])), d = o !== void 0 && n !== void 0;
  return /* @__PURE__ */ r(R, { ...e, children: /* @__PURE__ */ r(
    E,
    {
      id: s,
      withActions: t,
      columns: a,
      rows: p,
      selectedRows: c,
      onSelectedRowsChange: u,
      rowKeyGetter: i,
      onRowsChange: G,
      focusOnRowKey: l,
      smoothScroll: w,
      checkedRows: h,
      onCheckedRowsChange: x,
      rowCellsBackground: m,
      treeProps: {
        rowGrouper: I,
        expandedGroupIds: d ? o : C,
        onExpandedGroupIdsChange: d ? n : g
      }
    }
  ) });
}
export {
  D as TreeDataGrid
};
