import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, createVNode, toDisplayString, normalizeClass, unref, renderSlot } from "vue";
import "../../../../../adapter-vue.mjs";
import TUIChatEngine from "@tencentcloud/chat-uikit-engine";
import Avatar from "../../../../common/Avatar/index.vue.mjs";
import { calculateTimestamp } from "../../../utils/utils.mjs";
const _hoisted_1 = { class: "simple-message-container" };
const _hoisted_2 = { class: "simple-message-avatar" };
const _hoisted_3 = { class: "simple-message-sender" };
const _hoisted_4 = { class: "simple-message-body" };
const _hoisted_5 = { class: "timestamp" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "message-container",
  props: {
    sender: { default: "" },
    avatar: { default: "" },
    type: {},
    time: {}
  },
  setup(__props) {
    const props = __props;
    const TYPES = TUIChatEngine.TYPES;
    const isNoPadding = computed(() => {
      return [TYPES.MSG_IMAGE, TYPES.MSG_VIDEO, TYPES.MSG_MERGER].includes(props.type);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          createVNode(Avatar, {
            url: props.avatar
          }, null, 8, ["url"])
        ]),
        createElementVNode("div", null, [
          createElementVNode("div", _hoisted_3, toDisplayString(props.sender), 1),
          createElementVNode("div", _hoisted_4, [
            createElementVNode("div", {
              class: normalizeClass({
                "simple-message-content": true,
                "no-padding": unref(isNoPadding)
              })
            }, [
              renderSlot(_ctx.$slots, "default", {}, void 0, true)
            ], 2),
            createElementVNode("div", _hoisted_5, toDisplayString(unref(calculateTimestamp)(props.time * 1e3)), 1)
          ])
        ])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
