import { React, PureComponent } from "react"; import { DateTime } from "luxon"; import { BarChart, Bar, LineChart, Line, CartesianGrid, XAxis, YAxis, Tooltip, ResponsiveContainer, Label, } from "recharts"; import GoatCounter from './GoatCounter'; const History = (props) => { const offset = DateTime.fromSQL(props.data[0].date, { zone: "UTC" }).setZone(DateTime.local().zoneName).toSeconds(); const data = props.data.map((d) => { return { value: d.value, date: DateTime.fromSQL(d.date, { zone: "UTC" }).setZone(DateTime.local().zoneName).toSeconds(), }; }); return ( <>
{DateTime.fromSeconds(label).toLocaleString()}
{payload[0].value}