import { useRouter } from "next/router"; import { mutate } from "swr"; import { IAnalyticsParams, IAnalyticsResponse } from "@plane/types"; // components import { Button, Loader } from "@plane/ui"; import { AnalyticsGraph, AnalyticsTable } from "@/components/analytics"; // ui // helpers import { ANALYTICS } from "@/constants/fetch-keys"; import { convertResponseToBarGraphData } from "@/helpers/analytics.helper"; // types // 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.

)} ); };