import { useState } from "react"; import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, } from "recharts"; import millify from "millify"; import Select from "@/components/Select"; import Icon from "@/components/Icon"; import { data } from "./data"; const durationOptions = [ { id: 1, name: "Last 7 days" }, { id: 2, name: "Last 14 days" }, { id: 3, name: "Last 21 days" }, ]; const Chart = ({}) => { const [duration, setDuration] = useState(durationOptions[0]); const formatterYAxis = (value: number) => { if (value === 0) { return "$0"; } return `$${millify(value, { lowercase: false, })}`; }; const CustomTooltip = ({ payload }: { payload: { value: number }[] }) => { if (payload && payload.length) { return (
Bitcoin : ${payload[0].value}
); } return null; }; return (
Bitcoin