import DocumentDirectory from "../document-directory.mjs";

/**
 * @import RollTable from "@client/documents/roll-table.mjs";
 */

/**
 * The World RollTable directory listing.
 * @extends {DocumentDirectory<RollTable>}
 */
export default class RollTableDirectory extends DocumentDirectory {
  /** @override */
  static DEFAULT_OPTIONS = {
    collection: "RollTable"
  };

  /** @override */
  static tabName = "tables";

  /* -------------------------------------------- */
  /*  Rendering                                   */
  /* -------------------------------------------- */

  /** @inheritDoc */
  _getEntryContextOptions() {
    return [
      {
        label: "TABLE.ACTIONS.DrawResult",
        icon: "fa-solid fa-dice-d20",
        onClick: (event, li) => {
          const table = this.collection.get(li.dataset.entryId);
          table.draw({displayChat: true});
        }
      },
      ...super._getEntryContextOptions()
    ];
  }
}
