import { v4 } from "uuid";
import  TabsWidgetIcon from "@/assets/widgetCover/tabs.svg";
import i18n from "@/i18n/config";
import { RESIZE_DIRECTION, WidgetConfig } from "@/widgetLibrary/interface";

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

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

export const TABS_WIDGET_CONFIG: WidgetConfig = {
  displayName: "tabs",
  widgetName: i18n.t("widget.tabs.name"),
  type: "TABS_WIDGET",
  icon: <TabsWidgetIcon />,
  keywords: ["Tabs", "选项卡"],
  sessionType: "NAVIGATION",
  resizeDirection: RESIZE_DIRECTION.HORIZONTAL,
  version: 0,
  defaults: {
    tabList: defaultTabList,
    viewList: defaultListView,
    align: "flex-start",
    colorScheme: "blue",
    tabPosition: "top",
    currentIndex: 0,
    currentKey: 0,
  },
};
