import React, { useContext } from 'react';
import { ConfigProvider, List as OldList, ListProps } from 'antd';

import classNames from 'classnames';
import './index.less';

interface ListExtraProps {}

const List = ({ ...props }: ListProps<any> & ListExtraProps) => {
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
  const prefixCls = getPrefixCls('btri-list');

  return (
    <OldList
      {...props}
      className={classNames(
        `${prefixCls}-box`,
        `${prefixCls}--${props.size}`,
        props.className,
      )}
    ></OldList>
  );
};

List.Item = OldList.Item;

export { List };
