'use client'; import { useState } from 'react'; import Link from 'next/link'; import { Sparkles } from 'lucide-react'; import { recommend, type UseCase, type CensorshipLevel, type ClientSupport, } from '@/lib/xray/protocols'; import { ToolFrame } from './tool-frame'; import { SelectField } from './shared/fields'; const cap = (s: string) => s.charAt(0).toUpperCase() + s.slice(1); export function ProtocolWizard() { const [useCase, setUseCase] = useState('general'); const [censorship, setCensorship] = useState('medium'); const [clientSupport, setClientSupport] = useState('modern'); const result = recommend({ useCase, censorship, clientSupport }); return (
setUseCase(v.toLowerCase() as UseCase)} options={['Censorship', 'General', 'Speed']} /> setCensorship(v.toLowerCase() as CensorshipLevel)} options={['High', 'Medium', 'Low']} /> setClientSupport(v.toLowerCase() as ClientSupport)} options={['Modern', 'Broad']} />
Recommended
{result.protocol} {result.transport} {result.security}

{result.rationale}

{result.links.map((link) => ( {link.title} → ))}
); } function Badge({ children }: { children: React.ReactNode }) { return ( {children} ); }