import  RadioGroupWidgetIcon  from "@/assets/widgetCover/radioGroup.svg";
import { RESIZE_DIRECTION, WidgetConfig } from "@/widgetLibrary/interface";
import { v4 } from "uuid";

const defaultListView = [
  { id: v4(), key: "View 1", label: "View 1", value: "View 1" },
  { id: v4(), key: "View 2", label: "View 2", value: "View 2" },
  { id: v4(), key: "View 3", label: "View 3", value: "View 3" },
];

export const RADIO_WIDGET_CONFIG: WidgetConfig = {
  type: "RADIO_WIDGET",
  displayName: "radio",
  widgetName: "Radio",
  icon: <RadioGroupWidgetIcon />,
  keywords: ["Radio", "文本输入框"],
  sessionType: "INPUTS",
  resizeDirection: RESIZE_DIRECTION.ALL,
  version: 0,
  defaults: {
    label: "Radio",
    name: "name",
    disabled: false,
    size: "small",
    color: "secondary",
    labelHidden: false,
    viewList: defaultListView,
    currentIndex: 0,
    direction: "horizontal",
    styles: { fontWeight: "bold" },
    optionConfigureMode: "static",
    labelAlign: "left",
    labelPosition: "left",
    labelWidth: "{{33}}",
    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,
    formDataKey: "radioButton",
  },
};
