Skip to content

Commit a71855e

Browse files
committed
feat: new empty state for enabled onboarding
1 parent 5fb3fae commit a71855e

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

studio/src/components/federatedgraphs-cards.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import { docsBaseURL } from '@/lib/constants';
55
import { formatMetric } from '@/lib/format-metric';
66
import { useChartData } from '@/lib/insights-helpers';
77
import { cn } from '@/lib/utils';
8-
import { ChevronDoubleRightIcon, CommandLineIcon, DocumentArrowDownIcon } from '@heroicons/react/24/outline';
8+
import {
9+
BoltIcon,
10+
BookmarkIcon,
11+
ChevronDoubleRightIcon,
12+
CommandLineIcon,
13+
DocumentArrowDownIcon,
14+
} from '@heroicons/react/24/outline';
915
import { Component2Icon } from '@radix-ui/react-icons';
1016
import { EnumStatusCode } from '@wundergraph/cosmo-connect/dist/common/common_pb';
1117
import { migrateFromApollo } from '@wundergraph/cosmo-connect/dist/platform/v1/platform-PlatformService_connectquery';
@@ -38,6 +44,7 @@ import { useMutation } from '@connectrpc/connect-query';
3844
import { useCheckUserAccess } from '@/hooks/use-check-user-access';
3945
import { useWorkspace } from '@/hooks/use-workspace';
4046
import { useCurrentOrganization } from '@/hooks/use-current-organization';
47+
import { useOnboarding } from '@/hooks/use-onboarding';
4148

4249
// this is required to render a blank line with LineChart
4350
const fallbackData = [
@@ -616,6 +623,7 @@ export const FederatedGraphsCards = ({ graphs, refetch }: { graphs?: FederatedGr
616623
const [token, setToken] = useState<string | undefined>();
617624
const [isMigrating, setIsMigrating] = useState(false);
618625
const checkUserAccess = useCheckUserAccess();
626+
const { onboarding, enabled, currentStep } = useOnboarding();
619627

620628
useEffect(() => {
621629
if (isMigrationSuccess) {
@@ -624,6 +632,24 @@ export const FederatedGraphsCards = ({ graphs, refetch }: { graphs?: FederatedGr
624632
}
625633
}, [isMigrationSuccess]);
626634

635+
if (enabled && onboarding && onboarding.federatedGraphsCount === 0) {
636+
return currentStep !== undefined && !onboarding.finishedAt ? (
637+
<EmptyState
638+
icon={<BookmarkIcon />}
639+
title="Dive right back in"
640+
description="Want to finish the onboarding and create your first federated graph?"
641+
actions={<Link href={`/onboarding/${currentStep}`}>Continue</Link>}
642+
/>
643+
) : (
644+
<EmptyState
645+
icon={<BoltIcon />}
646+
title="Need help?"
647+
description="Take a quick 5-minute tour to help you set up your first federated graph"
648+
actions={<Link href={`/onboarding/1`}>Start here</Link>}
649+
/>
650+
);
651+
}
652+
627653
if (!graphs || graphs.length === 0)
628654
return (
629655
<Empty

0 commit comments

Comments
 (0)