import React from "react";
import DotsVertical from "@pisell/icon/es/DotsVertical";
import { locales } from "@pisell/utils";
import { Dropdown } from "antd";
import dayjs from "dayjs";
import "./index.less";
var NoteItem = function NoteItem(props) {
  var defaultMenus = [{
    key: "edit",
    label: locales.getText("pisell2.text.status.edit-note")
  }, {
    key: "remove",
    label: locales.getText("pisell2.text.status.remove-note")
  }];
  var isEdit = props.isEdit,
    onChange = props.onChange,
    item = props.item,
    _props$menus = props.menus,
    menus = _props$menus === void 0 ? defaultMenus : _props$menus;
  var menuChange = function menuChange(e) {
    onChange === null || onChange === void 0 || onChange(item, e.key);
  };
  return /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__booking-notes-item"
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__booking-notes-item-note"
  }, item.content || "-", isEdit ? /*#__PURE__*/React.createElement(Dropdown, {
    menu: {
      items: menus,
      onClick: menuChange
    },
    placement: "bottomRight"
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__booking-notes-menu-wrap"
  }, /*#__PURE__*/React.createElement(DotsVertical, {
    className: "pisell-lowcode__booking-notes-menu-icon"
  }))) : null), item.created_at ? /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__booking-notes-item-date"
  }, locales.getText("pisell2.text.status.from-system-add"), " ", dayjs(item.created_at).format("HH:mm:ss DD/MM/YYYY")) : null);
};
export default NoteItem;