import { defineComponent, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createTextVNode, toDisplayString, createElementVNode } from 'vue';
import { s as script$1 } from './headerText-0fd3adc1.mjs';
import { s as script$2 } from './normalText-66005fcf.mjs';
import script$3 from './TsAvatar.mjs';
import { s as script$4 } from './textField-db6aa9a7.mjs';
import script$5 from './TsButton.mjs';
import script$6 from './TsIcon.mjs';
import './TsImageLoader.mjs';

var script = defineComponent({
    components: {
        TsHeaderText: script$1,
        TsNormalText: script$2,
        TsAvatar: script$3,
        TsTextField: script$4,
        TsButton: script$5,
        TsIcon: script$6,
    },
    props: {
        customClass: {
            type: String,
            default: "",
        },
        data: {
            type: Array,
            required: true,
        },
    },
    name: "TsDiscussion",
});

const _hoisted_1 = { class: "flex flex-col items-start space-y-2 border-[1px] border-gray-200 rounded px-3 py-3 mdlg:!px-5 mdlg:!py-5" };
const _hoisted_2 = /*#__PURE__*/createTextVNode(" Discussion ");
const _hoisted_3 = { class: "flex flex-col space-y-[1px] flex-grow" };
const _hoisted_4 = { class: "w-full flex flex-row space-x-2 pt-2 items-center justify-between" };

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_ts_header_text = resolveComponent("ts-header-text");
  const _component_ts_avatar = resolveComponent("ts-avatar");
  const _component_ts_normal_text = resolveComponent("ts-normal-text");
  const _component_ts_text_field = resolveComponent("ts-text-field");
  const _component_ts_icon = resolveComponent("ts-icon");
  const _component_ts_button = resolveComponent("ts-button");

  return (openBlock(), createElementBlock("div", _hoisted_1, [
    createVNode(_component_ts_header_text, { customClass: 'pb-2' }, {
      default: withCtx(() => [
        _hoisted_2
      ]),
      _: 1 /* STABLE */
    }),
    (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (message, index) => {
      return (openBlock(), createElementBlock("div", {
        class: "w-full flex flex-row space-x-2 items-start",
        key: index
      }, [
        createVNode(_component_ts_avatar, {
          photoUrl: message.photoUrl,
          size: '32',
          bgColor: 'bg-primaryPurple',
          customClass: 'text-white min-w-[32.5px]'
        }, {
          default: withCtx(() => [
            createTextVNode(toDisplayString(message.photoUrl ? "" : message.username.charAt(0)), 1 /* TEXT */)
          ]),
          _: 2 /* DYNAMIC */
        }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["photoUrl", "customClass"]),
        createElementVNode("div", _hoisted_3, [
          createVNode(_component_ts_header_text, {
            size: "xs",
            customClass: 'text-left'
          }, {
            default: withCtx(() => [
              createTextVNode(toDisplayString(message.username), 1 /* TEXT */)
            ]),
            _: 2 /* DYNAMIC */
          }, 1024 /* DYNAMIC_SLOTS */),
          createVNode(_component_ts_normal_text, { customClass: ' text-left' }, {
            default: withCtx(() => [
              createTextVNode(toDisplayString(message.content), 1 /* TEXT */)
            ]),
            _: 2 /* DYNAMIC */
          }, 1024 /* DYNAMIC_SLOTS */)
        ])
      ]))
    }), 128 /* KEYED_FRAGMENT */)),
    createElementVNode("div", _hoisted_4, [
      createVNode(_component_ts_text_field, {
        placeholder: 'Write a message',
        customClass: 'border-[1px] w-full'
      }),
      createVNode(_component_ts_button, { padding: 'px-4 py-3' }, {
        default: withCtx(() => [
          createVNode(_component_ts_icon, {
            name: 'send',
            customClass: 'h-[20px]'
          })
        ]),
        _: 1 /* STABLE */
      })
    ])
  ]))
}

script.render = render;
script.__file = "src/components/TsDiscussion/index.vue";

export { script as default };
