import {
  Box
} from "./chunk-4Y5BEXVN.js";

// src/layouts/response-display.tsx
import { Fragment, jsx } from "react/jsx-runtime";
var breakpoints = ["initial", "xs", "sm", "md", "lg", "xl"];
var sortByBreakpoint = (a, b) => {
  return breakpoints.indexOf(a[0]) - breakpoints.indexOf(b[0]);
};
var getDisplay = (prev, cur, index) => {
  const result = {};
  if (prev) {
    result.initial = "none";
  }
  if (cur) {
    result[cur] = "block";
  }
  if (index) {
    result[index] = "none";
  }
  return result;
};
function ResponseDisplay(props) {
  const sortedChildren = Object.entries(props).sort(sortByBreakpoint);
  return /* @__PURE__ */ jsx(Fragment, { children: sortedChildren.map(([key, value], index) => {
    var _a, _b, _c;
    return /* @__PURE__ */ jsx(
      Box,
      {
        display: getDisplay(
          (_a = sortedChildren[index - 1]) == null ? void 0 : _a[0],
          (_b = sortedChildren[index]) == null ? void 0 : _b[0],
          (_c = sortedChildren[index + 1]) == null ? void 0 : _c[0]
        ),
        children: value
      },
      key
    );
  }) });
}

export {
  ResponseDisplay
};
//# sourceMappingURL=chunk-3BDAXSFJ.js.map