xuchang-screen/src/components/yx-dark/Header.jsx
2023-09-10 21:44:05 +08:00

27 lines
696 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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