import Button from './button'
import ImageButton from './image-button'
import Label from './label'
import MatrixButton from './button-matrix/index'
import Image from './image'
import SpanGroup from './span-group/index'
import Textarea from './textarea'
import Keyboard from './keyboard'
import Animimg from './animimg'
import Dropdown from './dropdown/index'
import Checkbox from './checkbox'
import Switch from './switch'
import Bar from './bar'
import Slider from './slider'

import Container from './container'
import Tabview from './tabview/index'
import Tileview from './tileview/index'
import Table from './table/index'
import List from './list/index'
import MessageBox from './message/index'
import Window from './window/index'
import Menu from './menu/index'

import Line from './line/index'
import Arc from './arc'
import Spinner from './spinner'
import Scale from './scale/index'
import Led from './led/index'
import Chart from './chart/index'
import Canvas from './canvas/index'
import Spinbox from './spinbox'
import Roller from './roller'

import Calendar from './calendar/index'
import DateText from './datetext/index'
import DagitalClock from './dagital-clock/index'
import AnalogClock from './analog-clock/index'
import BaseMeter from './base-meter/index'

import Lottie from './lottie'
import Video from './video/index'
import QRCode from './qrcode/index'
import Barcode from './barcode/index'

import Page from './page'
import { IComponentModelConfig } from './type'

export const ComponentArray = [
  Page,

  Button,
  ImageButton,
  MatrixButton,
  Image,
  Label,
  SpanGroup,
  Textarea,
  Dropdown,
  Checkbox,
  Switch,
  Bar,
  Slider,

  Container,
  Tabview,
  Tileview,
  Table,
  List,
  MessageBox,
  Window,
  Menu,

  Line,
  Arc,
  Scale,
  Led,
  Chart,
  Canvas,
  Spinner,
  Roller,
  Spinbox,
  Keyboard,

  Animimg,

  Calendar,
  DateText,
  DagitalClock,
  AnalogClock,

  Video,

  Lottie,
  QRCode,
  Barcode,

  BaseMeter
] as IComponentModelConfig[]

const componentMap: { [key: string]: IComponentModelConfig } = ComponentArray.reduce((acc, cur) => {
  acc[cur.key] = cur
  return acc
}, {})

export default componentMap
