import React from 'react';
import { Button, Divider } from 'antd'

import './style.less'

export default function MainTitle(props) {
  const { title, btnText, btnClick, accessTime } = props
  return (
    <div className="com-mainTile">
      <div className="spaceBetween">
        <div className="titleBox">
          <div className="title">
            {title}
            {
              accessTime && <span className="accessTime">{accessTime}</span>
            }
          </div>
        </div>
        {
          btnText &&
          <div>
            <Button type="primary" size="default" onClick={() => btnClick()}>{ btnText }</Button>
          </div>
        }
      </div>
      <Divider className="marginTop10 marginBottom10"/>
    </div>
  );
}