// recharts import { CartesianGrid, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; // ui import { CustomMenu } from "components/ui"; // constants import { MONTHS } from "constants/project"; type Props = { issues: | { week_in_month: number; completed_count: number; }[] | undefined; month: number; setMonth: React.Dispatch>; }; export const CompletedIssuesGraph: React.FC = ({ month, issues, setMonth }) => { const weeks = month === 2 ? 4 : 5; const data: any[] = []; for (let i = 1; i <= weeks; i++) { data.push({ week_in_month: i, completed_count: issues?.find((item) => item.week_in_month === i)?.completed_count ?? 0, }); } const CustomTooltip = ({ payload, label }: any) => (

{label}

Completed issues: {payload[0]?.value}
); return (

Issues closed by you

{MONTHS[month - 1]}} noBorder> {MONTHS.map((month, index) => ( setMonth(index + 1)}> {month} ))}
} />

Completed Issues

); };