import { useState } from 'react'; import { colors, fonts } from '@formiq/core'; import FormsTab from './components/FormsTab'; type Tab = 'dashboard' | 'forms' | 'settings'; const TABS: { id: Tab; label: string }[] = [ { id: 'dashboard', label: 'Dashboard' }, { id: 'forms', label: 'Forms' }, { id: 'settings', label: 'Settings' }, ]; // wp_localize_script sets window.formiqConfig — use window explicitly so Vite // doesn't evaluate the typeof check at bundle time and collapse it to false. const wpConfig = (window as unknown as Record)['formiqConfig'] as { restUrl: string; nonce: string; version: string; logoUrl?: string; plan?: string } | undefined; export default function App() { const [activeTab, setActiveTab] = useState('dashboard'); const logoUrl = wpConfig?.logoUrl; const plan = wpConfig?.plan ?? 'free'; const isPro = plan === 'pro'; return (
{/* Branded header */}
{/* GTS logo */} {logoUrl ? ( Ganda Tech Services ) : (
GTS
)}

FormIQ

WordPress

AHPRA-compliant forms. Generated in 60 seconds.

by Ganda Tech Services
{/* Tab nav */} {/* Content */}
{activeTab === 'dashboard' && } {activeTab === 'forms' && } {activeTab === 'settings' && }
{/* Footer */}
); } function StatCard({ label, value, accent, planColor }: { label: string; value: string; accent?: boolean; planColor?: string }) { const accentColor = planColor ?? colors.primary; return (

{label}

{value}

); } function DashboardTab({ isPro }: { isPro: boolean }) { const planLabel = isPro ? 'Pro' : 'Free'; const planColor = isPro ? '#f59e0b' : colors.primary; const calloutBg = isPro ? '#fffbeb' : colors.purpleLight; const calloutBorder = isPro ? 'rgba(245,158,11,0.3)' : 'rgba(108,99,255,0.2)'; return (

Your forms are ready to build.

Select your specialty. FormIQ generates a complete, AHPRA-compliant intake form in under 60 seconds.

{isPro ? '★' : '✦'}
{isPro ? ( <>

Pro Plan Active

You have unlimited form generation, priority AI processing, AHPRA compliance checks, and bulk export — all premium features unlocked.

) : ( <>

Generate your first form — free

Head to the Forms tab, select your specialty, and FormIQ builds a complete intake form tailored to your practice — no templates, no guesswork.

)}
); } function SettingsPanel() { return (
⚙️

Settings

Manage your API key, license, and account preferences.

); }