import { useProp, h } from 'atomico';
import { g as getComponentOrDefine } from './chunks/65ef80fe.js';

var style = ".title {\n  height: 70px;\n  line-height: 70px;\n  padding: 0 25px;\n  font-size: 18px;\n  color: #333;\n}\n\n.item {\n  border-top: 0.5px solid #F2F2F2;\n  line-height: 25px;\n  padding: 25px 24px;\n  box-sizing: border-box;\n  text-align: justify;\n  font-size: 14px;\n  color: #333;\n}\n";

const _jsxFileName = "/Users/rang/rang/frond_ng/packages/six/src/components/kun-article-list/kun-article-list.tsx"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }





const KunArticle = ({ message }) => {
  const [list] = useProp("posts");
  const openLink = (url) => {
    window.open(url, "_blank");
  };
  return (
    h('host', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 16}}
      , h('style', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 17}}, style)
      , h('div', { class: "max-w-sm rounded overflow-hidden shadow-lg"   , __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 18}}
        , h('div', { className: "title", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 19}}, _nullishCoalesce(message, () => ( "dd")))
        , 
        list.map((item) => (
          h('div', {
            role: "presentation",
            key: item.title,
            className: "item transition cursor-pointer duration-500 ease-in-out hover:bg-gray-200 transform"      ,
            onclick: () => openLink(item.url), __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 22}}
          
            , item.title 
          )
        ))
      
      )
    )
  );
};

KunArticle.props = {
  posts: {
    type: Array,
    value: [{
      title: "a",
      url: "http",
    }],
  },
  message: {
    type: String,
    value: "kun-article-list",
    reflect: true,
    event: {
      type: "changeMessage",
    },
  },
};

var kunArticleList = getComponentOrDefine("kun-article-list", KunArticle);

export default kunArticleList;
