Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1x | import { isCmsUser } from "shared-utils"; import { useGetUser } from "@/api"; import * as F from "@/features"; import { useFeatureFlag } from "@/hooks/useFeatureFlag"; export const WelcomeWrapper = () => { const { data: user } = useGetUser(); const isEnabled = useFeatureFlag("CMS_HOMEPAGE_FLAG"); // Check if the user exists and has a CMS role return user && isCmsUser(user.user) && isEnabled ? <F.CMSWelcome /> : <F.Welcome />; // Uncomment to test the CMSWelcome component: // return <F.CMSWelcome />; }; |