import { useProp, useEvent, 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-post-list-header/kun-post-list-header.tsx";
const KunPostListHeader = () => {
  const [cardProps] = useProp("post");
  const [seriesProps] = useProp("series");

  const defaultCard = {
    title: "做一个好人",
  } ;
  const defaultSeries = {
    title: "做一个好人",
    coverImageName: "HKrq8LbEEeq11V94e6TtHg==.png",
  } ;

  const clickEvent = useEvent("MyClick", {
    composed: true,
    bubbles: true,
  });

  const card = Option.of(cardProps).getOrElse(defaultCard);
  const series = Option.of(seriesProps).getOrElse(defaultSeries);
  return (
    h('host', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 34}}
      , h('style', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 35}}, style)
      , h('div', { class: "py-4 bg-gray-400 w-full px-8"   , __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 36}}
        , h('div', { class: "flex flex-row" , __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 37}}
          , h('kun-image-or-default', { url: getKunImageUrl(series.coverImageName), width: 65, height: 65, __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 38}} )
          , h('div', { className: "ml-2 text-white text-xl cursor-pointer"   , onclick: () => clickEvent({}), __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 39}}, card.title)
        )
      )
    )
  );
};

KunPostListHeader.props = {
  series: {
    type: Object,
    reflect: true,
    event: {
      type: "changeMessage",
    },
  },
  post: {
    type: Object,
    reflect: true,
    event: {
      type: "changeMessage",
    },
  },
  message: {
    type: String,
    value: "kun-post-list-heade-dr",
    reflect: true,
    event: {
      type: "changeMessage",
    },
  },
};

var kunPostListHeader = getComponentOrDefine("kun-post-list-header", KunPostListHeader);

export default kunPostListHeader;
