import { jsx as u } from "react/jsx-runtime";
import { forwardRef as l, useState as c } from "react";
import { Classes as d } from "../../constants/selectors.js";
import { useIsomorphicLayoutEffect as w } from "../../hooks/use-isomorphic-layout-effect.js";
import { cn as V } from "../../utils/cn.js";
const v = l(
  ({ children: t, title: r, items: o, className: i, ...s }, m) => {
    var e;
    const [f, a] = c(!1);
    w(() => {
      a(!0);
    }, []);
    const n = (e = o.find((p) => p.title === r)) == null ? void 0 : e.active;
    return f && n ? /* @__PURE__ */ u(
      "div",
      {
        className: V(
          d.MultiViewItem,
          "prose dark:prose-invert",
          i
        ),
        ref: m,
        ...s,
        children: t
      }
    ) : null;
  }
);
v.displayName = "View";
export {
  v as View
};
