import * as React from "react";
import { action } from "@storybook/addon-actions";
import { withKnobs, text, boolean, select } from "@storybook/addon-knobs";

import DropdownField from "./DropdownField";
import { EditorMode } from "../../../../Editor/types";
import { IListItem } from "../types";

export default {
  title: "Modules|CRUD/FormBuilder/Form Fields/DropdownField",
  component: DropdownField,
  excludeStories: /.*data$/,
};

export const data: IListItem[] = [
  { id: "1", label: "Kyle" },
  { id: "2", label: "Linda" },
  { id: "3", label: "Mikel" },
  { id: "4", label: "Nevaeh" },
];

export const Live: any = () => (
  <DropdownField mode={EditorMode.LIVE} data={data} />
);

export const Edit: any = () => (
  <DropdownField mode={EditorMode.EDITOR} data={data} />
);

Live.story = {
  parameters: {
    jest: ["DropdownField"],
  },
};
