add frontend docker build and deploy and gitea action
This commit is contained in:
@@ -1,25 +1,20 @@
|
||||
import { ScatterChart, Scatter, XAxis, YAxis, Tooltip, ResponsiveContainer } from "recharts";
|
||||
import {lazy, Suspense } from "react"
|
||||
import WeatherHistory from '@/hooks/weather-history'
|
||||
|
||||
const Chart = lazy(() => import("./temperature-plot-chart"))
|
||||
|
||||
function TemperaturePlot() {
|
||||
const {data, isLoading, error} = WeatherHistory()
|
||||
|
||||
if (isLoading) return <p>Loading...</p>
|
||||
if (error) return <p>Error: {error.message}</p>
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
<ResponsiveContainer width="100%" height={400}>
|
||||
<ScatterChart data={data}>
|
||||
<XAxis dataKey="id" />
|
||||
<YAxis />
|
||||
<Tooltip />
|
||||
<Scatter dataKey="temp" fill="#6366f1" />
|
||||
</ScatterChart>
|
||||
</ResponsiveContainer>
|
||||
</div>
|
||||
<Suspense fallback={<div className="h-[400-px]" />}>
|
||||
<Chart data={data} />
|
||||
</Suspense>
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default TemperaturePlot
|
||||
|
||||
|
||||
Reference in New Issue
Block a user