Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
"use client";
import {
LineChart,
Line,
XAxis,
YAxis,
CartesianGrid,
Tooltip,
ResponsiveContainer,
} from "recharts";
const formatChartData = (moisture: number) => [
{ time: "now", moisture },
];
export default function MoistureGraph({ moisture = 0 }: { moisture?: number }) {
const chartData = formatChartData(moisture);
return (
<div className="mt-4 h-64 w-full">
<ResponsiveContainer width="100%" height="100%">
<LineChart data={chartData}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="time" />
<YAxis domain={[0, 100]} unit="%" />
<Tooltip />
<Line
type="monotone"
dataKey="moisture"
stroke="#4ade80"
strokeWidth={2}
dot={{ r: 3 }}
/>
</LineChart>
</ResponsiveContainer>
</div>
);
}
04fc3be0cThis file is pinned to the selected release. Download the original to open it in your design tool.