File tree Expand file tree Collapse file tree
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/onboarding Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import { Switch , Typography } from "@/components/ui" ;
4+ import { EnvelopeSimple } from "@phosphor-icons/react" ;
5+
6+ const DESCRIPTION =
7+ "Require a verified primary email before users can continue after sign-up." ;
8+
9+ const SWITCH_ID = "onboarding-email-verification" ;
10+
11+ export type OnboardingEmailVerificationSettingProps = {
12+ isEnabled : boolean ,
13+ isToggling : boolean ,
14+ onCheckedChange : ( checked : boolean ) => void ,
15+ } ;
16+
17+ /**
18+ * Settings-strip layout: label + description + switch in one compact row.
19+ */
20+ export function OnboardingEmailVerificationSetting ( {
21+ isEnabled,
22+ isToggling,
23+ onCheckedChange,
24+ } : OnboardingEmailVerificationSettingProps ) {
25+ return (
26+ < div className = "flex flex-col gap-3 rounded-2xl bg-foreground/[0.02] p-4 ring-1 ring-foreground/[0.06] sm:flex-row sm:items-center sm:justify-between" >
27+ < div className = "flex min-w-0 items-start gap-3" >
28+ < div className = "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-foreground/[0.04] ring-1 ring-foreground/[0.06]" >
29+ < EnvelopeSimple className = "h-4 w-4 text-muted-foreground" />
30+ </ div >
31+ < label htmlFor = { SWITCH_ID } className = "min-w-0 cursor-pointer" >
32+ < Typography className = "text-sm font-medium text-foreground" >
33+ Require email verification
34+ </ Typography >
35+ < Typography variant = "secondary" className = "text-xs" >
36+ { DESCRIPTION }
37+ </ Typography >
38+ </ label >
39+ </ div >
40+ < div className = "flex shrink-0 justify-end sm:pl-4" >
41+ < Switch
42+ id = { SWITCH_ID }
43+ checked = { isEnabled }
44+ disabled = { isToggling }
45+ loading = { isToggling }
46+ onCheckedChange = { onCheckedChange }
47+ />
48+ </ div >
49+ </ div >
50+ ) ;
51+ }
You can’t perform that action at this time.
0 commit comments