import React from 'react';
import { Dropdown, Button } from 'antd';
import classNames from 'classnames';
import PisellTags from "../pisellTags";
import PisellCard from "../pisellCard";
import PisellAvatar from "../pisellAvatar";
import "./PisellAppCard.less";
import Icon from "../icon";
var PisellAppCard = function PisellAppCard(_ref) {
  var className = _ref.className,
    style = _ref.style,
    avatar = _ref.avatar,
    tags = _ref.tags,
    title = _ref.title,
    description = _ref.description,
    bottomButtons = _ref.bottomButtons,
    moreActions = _ref.moreActions,
    icon = _ref.icon;
  return /*#__PURE__*/React.createElement(PisellCard, {
    className: classNames('pisell-lowcode-app-card', className),
    style: style
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode-app-card-header"
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode-app-card-header-left"
  }, (avatar || icon) && /*#__PURE__*/React.createElement(PisellAvatar, {
    icon: icon && /*#__PURE__*/React.createElement(Icon, {
      type: icon
    }),
    src: avatar || undefined,
    alt: title,
    size: "xl",
    shape: "square",
    style: {
      border: 'none'
    },
    borderRadius: 10
  })), /*#__PURE__*/React.createElement("div", null, moreActions && moreActions.length > 0 && /*#__PURE__*/React.createElement(Dropdown, {
    menu: {
      items: moreActions.map(function (action, index) {
        return {
          key: index,
          label: action.label,
          onClick: action.onClick
        };
      })
    },
    placement: "bottomRight",
    trigger: ['click']
  }, /*#__PURE__*/React.createElement(Button, {
    icon: /*#__PURE__*/React.createElement(Icon, {
      type: "pisell2-dots-vertical"
    }),
    size: "large"
  })))), /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode-app-card-content"
  }, tags && tags.length > 0 && /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode-app-card-content-tags"
  }, tags.map(function (tag, index) {
    return /*#__PURE__*/React.createElement(PisellTags, {
      key: index,
      type: tag.type,
      color: tag.color
    }, tag.label);
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode-app-card-content-title"
  }, title), description && /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode-app-card-content-description"
  }, description))), bottomButtons && bottomButtons.length > 0 && /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode-app-card-footer"
  }, bottomButtons.map(function (button, index) {
    return !button.hidden && /*#__PURE__*/React.createElement(Button, {
      type: button.type,
      onClick: button.onClick,
      key: index,
      size: "large"
    }, button.label);
  })));
};
export default PisellAppCard;