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

var style = ".needle-button {\n  cursor: pointer;\n  padding: 0 16px;\n  color:rgba(156,156,156,1);\n  height:49px;\n  outline: none;\n  line-height: 49px;\n  background:rgba(255,255,255,1);\n  border-radius:5px;\n  border:1px solid rgba(233,233,233,1);\n}\n\n.needle-button > kun-icon {\n  margin-right: 10px;\n}\n\n.inline-flex {\n  display: inline-flex;\n}\n\n.items-center {\n  align-items: center;\n}\n\n.button-normal {\n  border-color: orange;\n}\n\n.button-normal {\n  color: orange;\n}\n";

const _jsxFileName = "/Users/rang/rang/frond_ng/packages/six/src/components/kun-button-puer/kun-button-puer.tsx";
const KunButtonPuer = () => {
  const [loading] = useProp("loading");
  const [type] = useProp("type");
  const [needleContent] = useProp("needleContent");
  const myClick = useEvent("MyClick", {
    bubbles: true,
    composed: true,
  });

  const onClick = () => {
    if (!loading) {
      myClick({});
    }
  };

  return (
    h('host', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 24}}
      , h('style', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 25}}, style)
      , h('button', {
        type: "button",
        onclick: onClick,
        className: `hover:text-orange-500 inline-flex text-sm items-center needle-button ${type === "normal" ? "button-normal" : ""} `, __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 26}}
      
        , 
            loading && (
            h('kun-icon', { iconType: "loading", iconWidth: 18, iconHeight: 18, __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 33}} )
            )
        
        , needleContent
      )
    )
  );
};

KunButtonPuer.props = {
  type: {
    type: String,
  },
  loading: {
    type: Boolean,
    value: false,
    reflect: true,
  },
  needleContent: {
    type: String,
    value: "确定",
    reflect: true,
    event: {
      type: "changeMessage",
    },
  },
};

getComponentOrDefine("kun-button-puer", KunButtonPuer );
