import React, { useEffect, useState, useRef } from 'react';
import './styles/header.module.css';
import moment from 'moment';

export default (props) => {
	let [today, setToday] = useState(new Date());
	moment.locale('zh-cn');
	setTimeout(() => {
		setToday(new Date());
	}, 1000);

	return (
		<header class="header">
			<div>
				<span class="header--logo"></span>
				<h1>宜兴新能源生产线大数据指挥中心</h1>
			</div>
			<span class="header--wing absolute company">
				设计单位：中建材智能自动化研究院
			</span>
			<span class="header--wing absolute datetime">
				{moment(today).format('YYYY.M.D dddd HH:mm:ss')}
			</span>
		</header>
	);
};
