"use client";
import { jsxs as a, jsx as r } from "react/jsx-runtime";
import { ChatMessage as l } from "./chat-message.js";
import { TypingIndicator as u } from "./typing-indicator.js";
function h({
  messages: n,
  showTimeStamps: c = !0,
  isTyping: d = !1,
  messageOptions: o,
  onEdit: t,
  onMessageSave: e
}) {
  return /* @__PURE__ */ a("div", { className: "space-y-4 overflow-visible", children: [
    n.map((i) => {
      const f = typeof o == "function" ? o(i) : o;
      return /* @__PURE__ */ r(
        l,
        {
          showTimeStamp: c,
          ...i,
          ...f,
          onEdit: t ? (p) => t(i.id, p) : void 0,
          onMessageSave: e
        },
        i.id
      );
    }),
    d && /* @__PURE__ */ r(u, {})
  ] });
}
export {
  h as MessageList
};
