+
:
}
+ >
+ {isFollowing ? 'Following' : 'Follow'}
+
+ {!isFollowing && (
+
}
+ >
+ Block
+
+ )}
+ {isShareVisible && (
+
+ )}
+
}
+ aria-label="Options"
+ />
+
+ );
+};
+
+// Storybook aliases `@growthbook/growthbook` to a mock whose `getFeatureValue`
+// coerces every falsy default to the truthy string `'control'`, so a flag can't
+// evaluate to `false` here. Flag-off is therefore simulated by holding the
+// features context as "not ready", which is the exact path
+// `useConditionalFeature` takes to fall back to the (false) default value.
+const withProviders =
+ (enabled: boolean) =>
+ (Story: React.ComponentType): React.ReactElement => {
+ const queryClient = new QueryClient({
+ defaultOptions: { queries: { retry: false, staleTime: Infinity } },
+ });
+
+ // Seed the resolved short URL for both campaigns so nothing hits network.
+ [ReferralCampaignKey.ShareTag, ReferralCampaignKey.ShareSource].forEach(
+ (cid) => {
+ Object.values(entityConfig).forEach((config) => {
+ const { queryKey } = getShortLinkProps(config.link, cid, mockUser);
+ queryClient.setQueryData(queryKey, SHORT_LINK);
+ });
+ },
+ );
+
+ const LogContext = getLogContextStatic();
+
+ return (
+