import React from 'react';
import AntdPageHeader from 'antd/es/page-header';

import Icons from '../icons';
import { ConfigContext } from '../config-provider';
import './index.less';

const { ArrowLeftIcon } = Icons;

export default props => {
  return (
    <ConfigContext>
      {({ getPrefixCls }) => {
        const { prefixCls: customizePrefixCls, ...restProps } = props;
        const prefixCls = getPrefixCls('page-header', customizePrefixCls);
        return (
          <AntdPageHeader
            backIcon={<ArrowLeftIcon fontSize="24" showHover />}
            ghost={false}
            {...restProps}
            prefixCls={prefixCls}
          />
        );
      }}
    </ConfigContext>
  );
};
