diff --git a/web/components/templates/dashboard/dashboardPage.tsx b/web/components/templates/dashboard/dashboardPage.tsx index 18c62a20ad..83d6ceba31 100644 --- a/web/components/templates/dashboard/dashboardPage.tsx +++ b/web/components/templates/dashboard/dashboardPage.tsx @@ -36,6 +36,7 @@ import CostPanel from "./panels/costsPanel"; import ErrorsPanel from "./panels/errorsPanel"; import RequestsPanel from "./panels/requestsPanel"; import { useDashboardPage } from "./useDashboardPage"; +import { useRouter } from "next/router"; interface DashboardPageProps {} @@ -54,6 +55,7 @@ export type Loading = T | "loading"; export type DashboardMode = "requests" | "costs" | "errors"; const DashboardPage = (props: DashboardPageProps) => { + const router = useRouter(); const [interval, setInterval] = useState("24h"); const [timeFilter, setTimeFilter] = useState<{ start: Date; @@ -285,32 +287,52 @@ const DashboardPage = (props: DashboardPageProps) => { }, }} /> -
- {metricsData.map((m, i) => ( - - ))} -
- - setMode(option.toLowerCase() as DashboardMode) - } - /> - {renderPanel()} + {metrics.totalRequests?.data?.data === 0 ? ( +
+

No requests found!

+ +

If you have data, please try changing your filters, otherwise

+

if this is your first time using Helicone, click below.

+ +
+ ) : ( + <> +
+ {metricsData.map((m, i) => ( + + ))} +
+ + setMode(option.toLowerCase() as DashboardMode) + } + /> + + {renderPanel()} + + )} ); diff --git a/web/pages/dashboard.tsx b/web/pages/dashboard.tsx index 39eed9adb7..cf1f6d38f6 100644 --- a/web/pages/dashboard.tsx +++ b/web/pages/dashboard.tsx @@ -41,18 +41,7 @@ export default Dashboard; export const getServerSideProps = withAuthSSR(async (options) => { const { userData: { user }, - supabaseClient, } = options; - const client = supabaseClient.getClient(); - const [hasOnboarded] = await Promise.all([checkOnboardedAndUpdate(client)]); - if (!hasOnboarded?.data) { - return { - redirect: { - destination: "/welcome", - permanent: false, - }, - }; - } return { props: {