Untitled
unknown
plain_text
4 years ago
977 B
7
Indexable
import React from 'react';
import VisitorChart from '../../components/charts/VisitorChart';
import TMSChart from '../../components/charts/TMSChart';
import AverageTimeChart from '../../components/charts/AverageTimeChart';
import ChartLayout from '../../components/ChartLayout';
import RVRChart from '../../components/charts/RVRChart';
import {getWeather} from '../../services/darksky.service'
const Dashboard = () => {
const [weathers, setWeathers] = React.useState([])
const [weatherParams, setWeatherParams] = React.useState({
date_start: 1648761765,
date_end: 1650662565
})
const getWeathers = async () => {
try{
const {data} = await getWeather(weatherParams)
setWeathers(data)
}catch(e){
}
}
React.useEffect(()=>{
getWeathers()
},[])
return (
<ChartLayout>
<VisitorChart weathers={weathers} />
<TMSChart />
<AverageTimeChart />
<RVRChart />
</ChartLayout>
);
};
export default Dashboard;
Editor is loading...