import { useRouter } from "next/router"; import { mutate } from "swr"; // components import { AnalyticsGraph, AnalyticsTable } from "components/analytics"; // ui import { Button, Loader } from "@plane/ui"; // helpers import { convertResponseToBarGraphData } from "helpers/analytics.helper"; // types import { IAnalyticsParams, IAnalyticsResponse } from "types"; // fetch-keys import { ANALYTICS } from "constants/fetch-keys"; type Props = { analytics: IAnalyticsResponse | undefined; error: any; fullScreen: boolean; params: IAnalyticsParams; }; export const CustomAnalyticsMainContent: React.FC = (props) => { const { analytics, error, fullScreen, params } = props; const router = useRouter(); const { workspaceSlug } = router.query; const yAxisKey = params.y_axis === "issue_count" ? "count" : "estimate"; const barGraphData = convertResponseToBarGraphData(analytics?.distribution, params); return ( <> {!error ? ( analytics ? ( analytics.total > 0 ? (
) : (

No matching issues found. Try changing the parameters.

) ) : ( ) ) : (

There was some error in fetching the data.

)} ); };