import React from 'react';
import AntdCard from 'antd/es/card';

import { ConfigConsumer } from '../config-provider';
import './index.less';

const Card = props => (
  <ConfigConsumer>
    {({ getPrefixCls }) => {
      const { prefixCls: customizePrefixCls, ...restProps } = props;
      const prefixCls = getPrefixCls('card', customizePrefixCls);
      return <AntdCard prefixCls={prefixCls} {...restProps} />;
    }}
  </ConfigConsumer>
);

export default Card;
