import i18n from "@/i18n/config"
import { PanelConfig } from "@/page/App/components/InspectPanel/interface"
import { VALIDATION_TYPES } from "@/utils/validationFactory"
import { generatorEventHandlerConfig } from "../PublicSector/utils/generatorEventHandlerConfig"
import { LAbEL_EVENT_HANDLER_CONFIG } from "./eventHandlerConfig"

const baseWidgetName = "label"
export const LABEL_PANEL_CONFIG: PanelConfig[] = [
  {
    id: `${baseWidgetName}-basic`,
    groupName: i18n.t("editor.inspect.setter_group.basic"),
    children: [
        {
            id: `${baseWidgetName}-label-label`,
            labelName: i18n.t("editor.inspect.setter_label.label"),
            attrName: "label",
            setterType: "INPUT_SETTER",
            expectedType: VALIDATION_TYPES.STRING,
          },
          {
            id: `${baseWidgetName}-label-noWrap`,
            labelName: "Wrap Text",
            attrName: "wrapText",
            setterType: "INPUT_SETTER",
            expectedType: VALIDATION_TYPES.BOOLEAN,
            defaultValue:true
          },
          {
            id: `${baseWidgetName}-label-align`,
            labelName: "Align Text",
            attrName: "align",
            setterType: "INPUT_SETTER",
            expectedType: VALIDATION_TYPES.STRING,
            defaultValue:"center"
          },
    ],
  },
  {
      id: `${baseWidgetName}-interaction`,
      groupName: "INTERACTION",
      children: [
        {
          ...generatorEventHandlerConfig(
            baseWidgetName,
            LAbEL_EVENT_HANDLER_CONFIG.events
          ),
        },
      ]},
  {
    id: `${baseWidgetName}-style`,
    groupName: i18n.t("editor.inspect.setter_group.style"),
    children: [
      {
        id: `${baseWidgetName}-validation-classesCondition`,
        labelName:"Style Class Condition",
        labelDesc: i18n.t("editor.inspect.setter_tooltip.form_data_key"),
        setterType: "INPUT_SETTER",
        expectedType: VALIDATION_TYPES.BOOLEAN,
        defaultValue:true,
        attrName: "isClassTrue",
      },
      {
        id: `${baseWidgetName}-style-classes`,
        labelName: "Select True CSS Classes  :",
        isSetterSingleRow:true,
        attrName: "trueClasses",
        setterType: "BASE_MULTI_SELECT_SETTER",
        expectedType: VALIDATION_TYPES.ARRAY,
      },
      {
        id: `${baseWidgetName}-style-classes`,
        labelName: "Select false CSS Classes  :",
        isSetterSingleRow:true,
        attrName: "falseClasses",
        setterType: "BASE_MULTI_SELECT_SETTER",
        expectedType: VALIDATION_TYPES.ARRAY,
      },

    ],
  },

]
