import { Box, ListItemAction, ListItemSection } from "@wix/design-system";
import classNames from "classnames";
import React, { useContext } from "react";
import { RicosContext } from "./../../ricos-context/index.js";
import { unreachable } from "./../../_shared/uncreachable.js";
import { AI_MODAL_PROMPT_LIST_ITEM } from "../data-hooks.js";
import styles from "./ai-content-modal-scss.js";
const PromptsList = React.forwardRef(
  ({ visible, prompts, highlightedIndex, onHighlight, onClick }, ref) => {
    const { t } = useContext(RicosContext);
    return /* @__PURE__ */ React.createElement(
      Box,
      {
        className: classNames(styles.listWrapper, {
          [styles.visible]: visible
        })
      },
      /* @__PURE__ */ React.createElement(
        Box,
        {
          paddingTop: "SP2",
          paddingBottom: "SP2",
          direction: "vertical",
          width: "100%",
          height: "100%",
          ref
        },
        prompts.map((prompt, index) => {
          switch (prompt.type) {
            case "prompt": {
              return /* @__PURE__ */ React.createElement(
                ListItemAction,
                {
                  dataHook: AI_MODAL_PROMPT_LIST_ITEM,
                  key: prompt.title,
                  title: t(prompt.title),
                  size: "small",
                  prefixIcon: prompt.icon ? /* @__PURE__ */ React.createElement(prompt.icon, null) : /* @__PURE__ */ React.createElement(React.Fragment, null),
                  highlighted: highlightedIndex === index,
                  suffix: highlightedIndex === index ? t("AIPlugin_PromptsList_Confirm_Suffix") : "",
                  onMouseEnter: () => onHighlight(index),
                  onMouseLeave: () => onHighlight(-1),
                  onClick: () => {
                    onClick(prompt);
                  }
                }
              );
            }
            case "section": {
              return /* @__PURE__ */ React.createElement(ListItemSection, { key: prompt.title, title: t(prompt.title) });
            }
            default: {
              throw unreachable(prompt);
            }
          }
        })
      )
    );
  }
);
export {
  PromptsList
};
//# sourceMappingURL=prompts-list.js.map
