// ui import { BarGraph, LineGraph } from "components/ui"; // types import { IDefaultAnalyticsResponse } from "types"; // constants import { MONTHS_LIST } from "constants/calendar"; type Props = { defaultAnalytics: IDefaultAnalyticsResponse; }; export const AnalyticsScope: React.FC = ({ defaultAnalytics }) => { const currentMonth = new Date().getMonth(); const startMonth = Math.floor(currentMonth / 3) * 3 + 1; const quarterMonthsList = [startMonth, startMonth + 1, startMonth + 2]; return (
SCOPE
Pending issues
`#f97316`} tooltip={(datum) => (
Issue count- {datum.indexValue ?? "No assignee"}:{" "} {datum.value}
)} axisBottom={{ tickValues: [], }} margin={{ top: 20 }} />
Most issues created
{defaultAnalytics.most_issue_created_user.map((user) => (
{user.assignees__email} {user.count}
))}
Most issues closed
{defaultAnalytics.most_issue_closed_user.map((user) => (
{user.assignees__email} {user.count}
))}

Issues closed in a year

({ x: MONTHS_LIST.find((m) => m.value === month)?.label.substring(0, 3), y: defaultAnalytics.issue_completed_month_wise.find((data) => data.month === month) ?.count || 0, })), }, ]} height="300px" colors={(datum) => datum.color} curve="monotoneX" margin={{ top: 20 }} enableArea />
); };