import { useProp, h } from 'atomico';
import { Option } from 'funfix';
import { g as getComponentOrDefine } from './chunks/65ef80fe.js';
import './kun-icon.js';
import './chunks/a234fa33.js';
import './kun-image-or-default.js';
import '@caedman/kit/dist/use-stylesheet';
import 'lazyload-image';
import './kun-image.js';
import 'dayjs';
import { getKunImageUrl } from './kun-chat-message.js';

var style = ":host {\n}\n";

const _jsxFileName = "/Users/rang/rang/frond_ng/packages/six/src/components/kun-rich-msg/kun-rich-msg.tsx";
const KunRichMsg = () => {
  const [msgProps] = useProp("message");

  const msg = Option.of(msgProps).getOrElse({
    msgContent: "7/KzoMb8EeqCHJ3T8JKVww==.png",
    msgType: "IMAGE",
  } );

  return (
    h('host', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 20}}
      , h('style', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 21}}, style)
      , h('span', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 22}}
        , 
            msg.msgType === "TXT" && (
            h('div', { class: "break-all", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 25}}
              , msg.msgContent
            )
            )
        
        , 
              msg.msgType === "TEXT" && (
              h('div', { class: "break-all", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 32}}
                , msg.msgContent
              )
              )
       
        , 
              msg.msgType === "IMAGE" && (
              h('sl-gallery', { prefix: msg.msgId, __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 39}}
                , h('sl-gallery-image', {
                  src: getKunImageUrl(msg.msgContent),
                  small: getKunImageUrl(msg.msgContent),
                  title: "图片", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 40}}
                )
              )
              )
      
      )
    )
  );
};

KunRichMsg.props = {
  message: {
    type: Object,
  },
};

var kunRichMsg = getComponentOrDefine("kun-rich-msg", KunRichMsg);

export default kunRichMsg;
