// import { HorizontalEndIcon, HorizontalStartIcon } from "@illa-design/react"
import i18n from "@/i18n/config"
import { PanelConfig } from "@/page/app/components/InspectPanel/interface"
import { VALIDATION_TYPES } from "@/utils/validationFactory"
// import { INPUT_EVENT_HANDLER_CONFIG } from "@/widgetLibrary/InputWidget/eventHandlerConfig"
// import { generatorEventHandlerConfig } from "@/widgetLibrary/PublicSector/utils/generatorEventHandlerConfig"

const baseWidgetName = "input"
export const INPUT_PANEL_CONFIG: PanelConfig[] = [
  {
    id: `${baseWidgetName}-basic`,
    groupName: i18n.t("editor.inspect.setter_group.basic"),
    children: [
      {
        id: `${baseWidgetName}-basic-type`,
        labelName: i18n.t("editor.inspect.setter_label.input.type"),
        labelDesc: i18n.t("editor.inspect.setter_tips.input.type"),
        attrName: "type",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "SEARCH_SELECT_SETTER",
        options: [
          {
            label: "Text",
            value: "text",
          },
          {
            label: "Number",
            value: "number",
          },
        ],
      },
      {
        id: `${baseWidgetName}-basic-defaultValue`,
        labelName: i18n.t("editor.inspect.setter_label.default_value"),
        labelDesc: i18n.t("editor.inspect.setter_tooltip.input_default_value"),
        attrName: "defaultValue",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "INPUT_SETTER",
      },
      {
        id: `${baseWidgetName}-basic-placeholder`,
        labelName: i18n.t("editor.inspect.setter_label.placeholder"),
        labelDesc: i18n.t("editor.inspect.setter_tooltip.placeholder"),
        attrName: "placeholder",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "INPUT_SETTER",
      },
      {
        id: `${baseWidgetName}-basic-helperText`,
        labelName: "HelperText",
        labelDesc: "HelperText",
        attrName: "helperText",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "INPUT_SETTER",
      },
    ],
  },
  {
    id: `${baseWidgetName}-label`,
    groupName: i18n.t("editor.inspect.setter_group.label"),
    children: [
      {
        id: `${baseWidgetName}-label-label`,
        labelName: i18n.t("editor.inspect.setter_label.label"),
        attrName: "label",
        setterType: "INPUT_SETTER",
        expectedType: VALIDATION_TYPES.STRING,
      },
    ],
  },
  {
    id: `${baseWidgetName}-interaction`,
    groupName: i18n.t("editor.inspect.setter_group.interaction"),
    children: [
      {
        id: `${baseWidgetName}-interaction-disabled`,
        labelName: i18n.t("editor.inspect.setter_label.disabled"),
        labelDesc: i18n.t("editor.inspect.setter_tooltip.disabled"),
        attrName: "disabled",
        setterType: "INPUT_SETTER",
        expectedType: VALIDATION_TYPES.BOOLEAN,
        placeholder: "{{false}}",
      },
      {
        id: `${baseWidgetName}-interaction-readonly`,
        labelName: "Multiline",
        labelDesc: "Multiline",
        attrName: "multiline",
        setterType: "INPUT_SETTER",
        placeholder: "{{false}}",
        expectedType: VALIDATION_TYPES.BOOLEAN,
      },
    ],
  },
  {
    id: `${baseWidgetName}-Adornments`,
    groupName: i18n.t("editor.inspect.setter_group.adornments"),
    children: [
      {
        id: `${baseWidgetName}-basic-type`,
        labelName: "StartIcon",
        labelDesc: "StartIcon",
        attrName: "startAdornmentIconName",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "SEARCH_SELECT_SETTER",
        options: [
          {
            label: "DeleteIcon",
            value: "DeleteIcon",
          },
          {
            label: "SendIcon",
            value: "SendIcon",
          },
          {
            label: "AddIcon",
            value: "AddIcon",
          },
        ],
      },
      {
        id: `${baseWidgetName}-basic-type`,
        labelName: "EndIcon",
        labelDesc: "EndIcon",
        attrName: "endAdornmentIconName",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "SEARCH_SELECT_SETTER",
        options: [
          {
            label: "DeleteIcon",
            value: "DeleteIcon",
          },
          {
            label: "SendIcon",
            value: "SendIcon",
          },
          {
            label: "AddIcon",
            value: "AddIcon",
          },
        ],
      },
      {
        id: `${baseWidgetName}-adornments-tooltip`,
        labelName: i18n.t("editor.inspect.setter_label.tooltip"),
        labelDesc: i18n.t("editor.inspect.setter_tooltip.tooltip"),
        attrName: "tooltipText",
        setterType: "INPUT_SETTER",
        expectedType: VALIDATION_TYPES.STRING,
      },
    ],
  },
  {
    id: `${baseWidgetName}-validation`,
    groupName: i18n.t("editor.inspect.setter_group.validation"),
    children: [
      {
        id: `${baseWidgetName}-interaction-readonly`,
        labelName: "Required",
        labelDesc: "Required",
        attrName: "required",
        setterType: "INPUT_SETTER",
        placeholder: "{{false}}",
        expectedType: VALIDATION_TYPES.BOOLEAN,
      },
      {
        id: `${baseWidgetName}-validation-hide-message`,
        labelName: i18n.t(
          "editor.inspect.setter_label.hide_validation_message",
        ),
        labelDesc: i18n.t(
          "editor.inspect.setter_tooltip.hide_validation_message",
        ),
        setterType: "INPUT_SETTER",
        expectedType: VALIDATION_TYPES.BOOLEAN,
        attrName: "hideValidationMessage",
      },
      {
        id: `${baseWidgetName}-validation-pattern`,
        labelName: i18n.t("editor.inspect.setter_label.pattern"),
        setterType: "SEARCH_SELECT_SETTER",
        attrName: "pattern",
        options: [
          {
            label: i18n.t(
              "editor.inspect.setter_default_value.validation_pattern.email",
            ),
            value: "Email",
          },
          {
            label: i18n.t(
              "editor.inspect.setter_default_value.validation_pattern.url",
            ),
            value: "URL",
          },
          {
            label: i18n.t(
              "editor.inspect.setter_default_value.validation_pattern.regex",
            ),
            value: "Regex",
          },
        ],
      },
      {
        id: `${baseWidgetName}-validation-regex`,
        labelName: i18n.t("editor.inspect.setter_label.regex"),
        setterType: "INPUT_SETTER",
        attrName: "regex",
        bindAttrName: ["pattern"],
        expectedType: VALIDATION_TYPES.STRING,
        shown: (value) => value === "Regex",
      },
      {
        id: `${baseWidgetName}-validation-max`,
        labelName: i18n.t("editor.inspect.setter_label.max_length"),
        setterType: "INPUT_SETTER",
        attrName: "maxLength",
        expectedType: VALIDATION_TYPES.NUMBER,
      },
      {
        id: `${baseWidgetName}-validation-min`,
        labelName: i18n.t("editor.inspect.setter_label.min_length"),
        setterType: "INPUT_SETTER",
        attrName: "minLength",
        expectedType: VALIDATION_TYPES.NUMBER,
      },
    ],
  },
  {
    id: `${baseWidgetName}-style`,
    groupName: i18n.t("editor.inspect.setter_group.style"),
    children: [
      {
        id: `${baseWidgetName}-basic-type`,
        labelName: "Variant",
        labelDesc: "Variant",
        attrName: "variant",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "SEARCH_SELECT_SETTER",
        options: [
          {
            label: "Standard",
            value: "standard",
          },
          {
            label: "Outlined",
            value: "outlined",
          },
          {
            label: "Filled",
            value: "filled",
          },
        ],
      },
      {
        id: `${baseWidgetName}-basic-type`,
        labelName: "Color",
        labelDesc: "Color",
        attrName: "color",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "SEARCH_SELECT_SETTER",
        options: [
          {
            label: "Primary",
            value: "primary",
          },
          {
            label: "Secondary",
            value: "secondary",
          },
          {
            label: "Success",
            value: "success",
          },
          {
            label: "Error",
            value: "error",
          },
          {
            label: "Info",
            value: "info",
          },
          {
            label: "Warning",
            value: "warning",
          },
        ],
      },
      {
        id: `${baseWidgetName}-basic-type`,
        labelName: "Size",
        labelDesc: "Size",
        attrName: "size",
        expectedType: VALIDATION_TYPES.STRING,
        setterType: "SEARCH_SELECT_SETTER",
        options: [
          {
            label: "small",
            value: "Small",
          },
          {
            label: "medium",
            value: "Medium",
          },
        ],
      },
    ],
  },
]
