import {
  AlignBottom,
  AlignBottomSmall,
  AlignCenterHorizontally,
  AlignCenterHorizontallySmall,
  AlignTop,
  AlignTopSmall
} from "@wix/wix-ui-icons-common";
import React, { useContext } from "react";
import { RicosContext } from "./../../../../ricos-context/index.js";
import { DropdownModal } from "./../../../../_shared/dropdown-modal/dropdown-modal.js";
import { ListItemSelect } from "./../../../../_shared/list-item-select/list-item-select.js";
const VERTICAL_ALIGNMENT_BUTTONS = {
  TOP: {
    commandKey: "TOP",
    icon: AlignTop,
    iconSmall: AlignTopSmall,
    tooltip: "Toolbar_VerticalAlignment_AlignTop_Tooltip",
    dataHook: "vertical-alignment-align-top"
  },
  MIDDLE: {
    commandKey: "MIDDLE",
    icon: AlignCenterHorizontally,
    iconSmall: AlignCenterHorizontallySmall,
    tooltip: "Toolbar_VerticalAlignment_AlignMiddle_Tooltip",
    dataHook: "vertical-alignment-align-middle"
  },
  BOTTOM: {
    commandKey: "BOTTOM",
    icon: AlignBottom,
    iconSmall: AlignBottomSmall,
    tooltip: "Toolbar_VerticalAlignment_AlignBottom_Tooltip",
    dataHook: "vertical-alignment-align-bottom"
  }
};
const VerticalAlignmentDropdown = ({
  dropdownOptions,
  onSelect,
  selectedId,
  closeModal
}) => {
  const { t, isMobile } = useContext(RicosContext);
  return /* @__PURE__ */ React.createElement(
    DropdownModal,
    {
      options: dropdownOptions.map(
        ({ dataHook, icon: Icon, iconMobile: IconMobile, id, label }) => /* @__PURE__ */ React.createElement(
          ListItemSelect,
          {
            key: id,
            dataHook,
            prefix: isMobile ? /* @__PURE__ */ React.createElement(IconMobile, null) : /* @__PURE__ */ React.createElement(Icon, null),
            selected: id === selectedId,
            onSelect: () => {
              onSelect(id);
              closeModal();
            },
            title: t(label)
          }
        )
      ),
      onCloseButtonClick: closeModal,
      title: t("TablePlugin_Toolbar_VerticalAlignment_Tooltip")
    }
  );
};
export {
  VERTICAL_ALIGNMENT_BUTTONS,
  VerticalAlignmentDropdown
};
//# sourceMappingURL=vertical-alignment-dropdown.js.map
