import { v4 } from "uuid";
import  SelectWidgetIcon  from "@/assets/widgetCover/select.svg";

import { RESIZE_DIRECTION, WidgetConfig } from "@/widgetLibrary/interface";
import i18n from "@/i18n/config";

export const SELECT_WIDGET_CONFIG: WidgetConfig = {
  type: "SELECT_WIDGET",
  displayName: "select",
  widgetName: i18n.t("widget.select.name"),
  icon: <SelectWidgetIcon />,
  keywords: ["Select", "选择器"],
  sessionType: "SELECT",
  resizeDirection: RESIZE_DIRECTION.HORIZONTAL,
  version: 0,
  defaults: {
    optionConfigureMode: "dynamic",
    multiple: false,
    defaultValue: [],
    id: "auto",
    label: "Select",
    name: "Select",
    manualOptions: [
      { id: `option-${v4()}`, label: "Option 1", value: "Option 1" },
      { id: `option-${v4()}`, label: "Option 2", value: "Option 2" },
      { id: `option-${v4()}`, label: "Option 3", value: "Option 3" },
    ],
    dataSources: "{{[]}}",
    hidden: false,
    freeSolo: false,
    currentIndex: 0,
    disabled: false,
    placeholder: "",
    tooltipText: "",
    variant: "outlined",
  },
};
