import React from 'react';
import { View } from '@tarojs/components';
import ListPagination from '../list/list-pagination';
import { CompDefault, MetaProps } from '../data-channel';
import connect from '../connect';

export interface Props extends MetaProps {
  // 列表项
  listItem: JSX.Element;
  // 列表筛选条件
  filters: JSX.Element[];
  // todo 这个字段要优化
  type?: string;
  // todo 这个字段要优化
  orientation?: string;
}

export interface State {}

const defaultValue: CompDefault<Props, State> = {
  props: {
    listItem: <View>我是一行</View>,
    filters: [],
    type: 'small',
    orientation: 'vertical',
  },
  state: {},
  meta: {},
};

/**
 * 区块-列表
 */
const BlockList = ({ listItem, filters, type, orientation }) => {
  return (
    <ListPagination
      listItem={listItem}
      filters={filters}
      type={type}
      orientation={orientation}
    />
  );
};

export default connect(BlockList, defaultValue);
