import { IconAtom as Atom, IconHexagon as Hexagon, type TablerIcon as IconComponent, IconShieldCheck as Shield, } from '@tabler/icons-react'; import { motion } from 'framer-motion'; import { useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router'; import { useDocsVisibility } from '@/hooks/api'; import { cn } from '@/lib/utils'; import logoIcon from '../assets/logo-icon.svg'; import { FresnelEdge } from './effects/FresnelEdge'; import { Button } from './ui/button'; /* * The three deploy modes as cards, in the visual language of the app's pricing * cards (icon, accent glow, Fresnel edge) with no price: the same app runs in * every mode, chosen per environment. A user's own plans live on /pricing. */ interface Mode { id: 'launch' | 'supercharge' | 'fortify'; name: string; /** The deploy mode behind the benefit, shown as a secondary line. */ mode: string; tagline: string; icon: IconComponent; accent: { icon: string; iconBox: string; bg: string; shadow: string; glow: string; edge: string; divider: string; }; highlighted: boolean; delay: number; } export function GrowthSection() { const { t } = useTranslation(); const { userDocsEnabled } = useDocsVisibility(); // The CTA sends people to the getting-started guide. With user docs turned // off there is no guide to send them to, so the button falls back to signup // rather than pointing at a route that now 404s. const ctaHref = userDocsEnabled ? '/docs/getting-started' : '/signup'; const modes: Mode[] = [ { id: 'launch', name: t('landing.growth.launch.name'), mode: t('landing.growth.launch.mode'), tagline: t('landing.growth.launch.tagline'), icon: Hexagon, accent: { icon: 'text-muted-foreground', iconBox: 'border-border/50 bg-muted/50', bg: 'bg-muted/30 dark:bg-background/50', shadow: '', glow: 'oklch(0.7 0.02 250 / 0.06)', edge: 'rgba(255, 255, 255, 0.08)', divider: 'bg-border/50', }, highlighted: false, delay: 0.1, }, { id: 'supercharge', name: t('landing.growth.supercharge.name'), mode: t('landing.growth.supercharge.mode'), tagline: t('landing.growth.supercharge.tagline'), icon: Atom, accent: { icon: 'text-primary', iconBox: 'border-primary/20 bg-primary/10', bg: 'bg-primary/[0.03] dark:bg-primary/[0.05]', shadow: 'shadow-lg shadow-primary/10', glow: 'oklch(0.82 0.14 192 / 0.08)', edge: 'oklch(0.82 0.14 192 / 0.2)', divider: 'bg-gradient-to-r from-transparent via-primary/30 to-transparent', }, highlighted: true, delay: 0.2, }, { id: 'fortify', name: t('landing.growth.fortify.name'), mode: t('landing.growth.fortify.mode'), tagline: t('landing.growth.fortify.tagline'), icon: Shield, accent: { icon: 'text-secondary-accent', iconBox: 'border-secondary-accent/20 bg-secondary-accent/10', bg: 'bg-secondary-accent/[0.03] dark:bg-secondary-accent/[0.05]', shadow: 'shadow-lg shadow-secondary-accent/10', glow: 'oklch(0.65 0.26 350 / 0.06)', edge: 'oklch(0.65 0.26 350 / 0.15)', divider: 'bg-gradient-to-r from-transparent via-secondary-accent/20 to-transparent', }, highlighted: false, delay: 0.3, }, ]; return (
{/* Header */}

{t('landing.growth.headline')}{' '} {t('landing.growth.headlineHighlight')}

{t('landing.growth.subheading')}

{modes.map((mode) => ( ))}
); } function ModeCard({ mode }: { mode: Mode }) { const Icon = mode.icon; return (
{/* Mouse-tracking glow */}
{/* Icon + name */}

{mode.name}

{/* Deploy mode behind the benefit */}
{mode.mode}

{mode.tagline}

); } /** * GlowTracker with customizable glow color per mode. */ function GlowTrackerCustom({ color }: { color: string }) { const ref = useRef(null); const [pos, setPos] = useState({ x: 0, y: 0 }); const [visible, setVisible] = useState(false); useEffect(() => { const el = ref.current; const parent = el?.parentElement; if (!parent) return; const handleMove = (e: MouseEvent) => { const rect = parent.getBoundingClientRect(); setPos({ x: e.clientX - rect.left, y: e.clientY - rect.top }); }; const handleEnter = () => setVisible(true); const handleLeave = () => setVisible(false); parent.addEventListener('mousemove', handleMove); parent.addEventListener('mouseenter', handleEnter); parent.addEventListener('mouseleave', handleLeave); return () => { parent.removeEventListener('mousemove', handleMove); parent.removeEventListener('mouseenter', handleEnter); parent.removeEventListener('mouseleave', handleLeave); }; }, []); return (
); }