remove the example code
This commit is contained in:
@@ -1,20 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React from 'react';
|
||||||
import axios from 'axios';
|
|
||||||
|
|
||||||
export const Overview: React.FC = () => {
|
export const Overview: React.FC = () => {
|
||||||
const [msg, setMsg] = useState('LOADING');
|
return <>OVERVIEW</>;
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
axios.get('http://localhost:3000/system/timestamp', {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${sessionStorage.getItem('token')}`,
|
|
||||||
}
|
|
||||||
}).then((response) => setMsg(new Date(response.data).toISOString()));
|
|
||||||
}, 5000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return <>OVERVIEW {msg}</>;
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user