import { SozlukApi } from '@dvn/sozluk/api';
import { Component, Event, h, Host, Prop, State } from '@stencil/core';
import { mentornityAnnouncementWrapperI18nDefault, MentornityAnnouncementWrapperI18nKey } from '../../view-wrappers/mentornity-announcements-page-wrapper/i18n';
import { sozlukEntries } from '../../view-wrappers/sozluk-entries';
export class MentornityAcceptApplicationButton {
  constructor() {
    this.isProgressing = false;
    this.setDictionaryLanguage = async () => {
      const apiSozluk = new SozlukApi().setLanguage(this.item.language).setContents(sozlukEntries);
      this.strings = await apiSozluk.getContent(MentornityAnnouncementWrapperI18nKey, mentornityAnnouncementWrapperI18nDefault);
    };
  }
  componentWillLoad() {
    this.setDictionaryLanguage();
  }
  render() {
    const { strings } = this;
    if (!strings)
      return;
    return (h(Host, { class: "d-flex align-items-center", style: { height: '30px' } },
      h("dvn-dropdown", { placement: "bottomLeft", trigger: "click" },
        h("dvn-icon-button", { iconName: 'uil uil-cog', class: "custom-settings-icon", iconScale: "large" }),
        h("div", { slot: "content" },
          h("dvn-info-summary", { onClick: () => this.showPreview.emit(this.item), title: strings.preview }),
          h("dvn-info-summary", { onClick: () => this.editAnnouncement.emit(this.item), title: strings.edit }),
          h("dvn-info-summary", { onClick: () => this.duplicateAnnouncement.emit(this.item), title: strings.duplicate }),
          h("dvn-info-summary", { onClick: () => this.deleteAnnouncement.emit(this.item._id), title: strings.delete })))));
  }
  static get is() { return "mentornity-announcements-dropdown-menu"; }
  static get originalStyleUrls() { return {
    "$": ["mentornity-announcements-dropdown-menu.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["mentornity-announcements-dropdown-menu.css"]
  }; }
  static get properties() { return {
    "item": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "DataModel",
        "resolved": "DataModel",
        "references": {
          "DataModel": {
            "location": "import",
            "path": "@dvn/core/models/data-model"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
  static get states() { return {
    "isProgressing": {},
    "error": {},
    "strings": {}
  }; }
  static get events() { return [{
      "method": "showPreview",
      "name": "showPreview",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }, {
      "method": "editAnnouncement",
      "name": "editAnnouncement",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }, {
      "method": "deleteAnnouncement",
      "name": "deleteAnnouncement",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }, {
      "method": "duplicateAnnouncement",
      "name": "duplicateAnnouncement",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
}
