import { jsx as o, jsxs as s } from "react/jsx-runtime";
import { alignItemsCenter as a, dFlex as d } from "./index-general.module.js";
import { classNames as p } from "./index-classNames.js";
import { AnimatedConditional as F } from "./index-AnimatedConditional.js";
import { TableProvider as u } from "./index-Table.js";
import { FooterPagination as v } from "./index-FooterPagination.js";
import { FooterShowMore as N } from "./index-FooterShowMore.js";
import { useContext as C } from "react";
import { FooterShowLess as b } from "./index-FooterShowLess.js";
import m from "./index-TableFooter.module.scss.js";
const M = (f) => {
  var l, c;
  const {
    children: h,
    provider: g = u
  } = f, i = C(g), {
    data: r
  } = i, e = (r == null ? void 0 : r.columns) ?? [], x = e == null ? void 0 : e.length, n = ((l = i.pagination) == null ? void 0 : l.limit) ?? 1, t = ((c = i.pagination) == null ? void 0 : c.total) ?? 1;
  return o("tfoot", {
    children: o("tr", {
      className: m.tableFooter,
      children: s("td", {
        colSpan: x,
        children: [s("div", {
          className: p(d, a),
          children: [o(F, {
            condition: n <= t && t > 6,
            children: s("div", {
              className: m.sideLeft,
              children: [o(b, {
                isHidden: n < t
              }), o(N, {
                isHidden: n === t
              })]
            })
          }), o("div", {
            className: p(d, a, m.sideRight),
            children: o(v, {})
          })]
        }), h ?? null]
      })
    })
  });
};
export {
  M as TableFooter
};
