import { jsx as r } from "react/jsx-runtime";
import o from "prop-types";
import { Box as n } from "@mui/material";
import { useSize as u } from "ahooks";
import { useState as c, useRef as p, useEffect as g } from "react";
function a({ children: h, initHeight: s = 0, slotProps: e = {} }) {
  const [f, m] = c(s), i = p(null), t = u(i);
  return g(() => {
    t?.height && m(t.height);
  }, [t?.height]), /* @__PURE__ */ r(
    n,
    {
      ...e?.root,
      sx: {
        height: f,
        overflow: "hidden",
        transition: "height 0.2s ease-in-out",
        ...e?.root?.sx
      },
      children: /* @__PURE__ */ r(n, { ...e?.container, ref: i, children: h })
    }
  );
}
a.propTypes = {
  initHeight: o.number,
  children: o.node.isRequired,
  slotProps: o.object
};
export {
  a as default
};
