Skip to content

Commit 46bc7ec

Browse files
committed
PoC
1 parent 5a5aabc commit 46bc7ec

File tree

1 file changed

+24
-2
lines changed
  • apps/dashboard/app/(main)/websites/[id]/flags

1 file changed

+24
-2
lines changed

apps/dashboard/app/(main)/websites/[id]/flags/page.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
'use client';
22

33
import { useFlags } from '@databuddy/sdk/react';
4-
import { FlagIcon } from '@phosphor-icons/react';
4+
import { FlagIcon, InfoIcon } from '@phosphor-icons/react';
55
import { useAtom } from 'jotai';
66
import { useParams } from 'next/navigation';
77
import { Suspense, useCallback, useState } from 'react';
88
import { Badge } from '@/components/ui/badge';
99
import { Card, CardContent } from '@/components/ui/card';
10+
import {
11+
Tooltip,
12+
TooltipContent,
13+
TooltipTrigger,
14+
} from '@/components/ui/tooltip';
1015
import { useWebsite } from '@/hooks/use-websites';
1116
import { trpc } from '@/lib/trpc';
1217
import { isAnalyticsRefreshingAtom } from '@/stores/jotai/filterAtoms';
@@ -145,7 +150,7 @@ export default function FlagsPage() {
145150
websiteName={website?.name || undefined}
146151
/>
147152
{experimentFlag.isReady && (
148-
<div className="flex items-center gap-2">
153+
<div className="flex items-center gap-3">
149154
<FlagIcon
150155
className="h-5 w-5"
151156
color={experimentFlag.enabled ? 'red' : 'blue'}
@@ -157,6 +162,23 @@ export default function FlagsPage() {
157162
) : (
158163
<Badge className="bg-blue-500 text-white">Blue Team</Badge>
159164
)}
165+
<Tooltip>
166+
<TooltipTrigger asChild>
167+
<InfoIcon className="h-4 w-4" weight="duotone" />
168+
</TooltipTrigger>
169+
<TooltipContent className="max-w-xs">
170+
<div className="space-y-2">
171+
<p className="font-medium">A/B Test Experiment</p>
172+
<p className="text-xs leading-relaxed">
173+
This is a proof-of-concept feature flag demonstrating A/B
174+
testing capabilities. Approximately 50% of users are randomly
175+
assigned to the "Red Team" experience, while the other 50% see
176+
the "Blue Team" experience. This live experiment helps test
177+
feature flag functionality and user experience variations.
178+
</p>
179+
</div>
180+
</TooltipContent>
181+
</Tooltip>
160182
</div>
161183
)}
162184
<Suspense fallback={<FlagsListSkeleton />}>

0 commit comments

Comments
 (0)