import { Fragment } from 'react'; import { useQuery } from '@tanstack/react-query'; import { apiFetch, assetsUrl } from '../lib/api'; import { useHeadlessScan } from '../hooks/useHeadlessScan'; import type { ScannableUrl } from '../lib/types'; const FEATURES: { title: string; desc: string; variant: 'score' | 'severity' | 'passed' | 'ai' }[] = [ { variant: 'score', title: 'Accessibility score', desc: 'Get a clear score to understand the accessibility status of each page.', }, { variant: 'severity', title: 'Issues by severity', desc: 'See critical, serious, warning and notice issues that need attention.', }, { variant: 'passed', title: 'Passed checks', desc: 'See what’s already working well, including the number of accessibility checks passed.', }, { variant: 'ai', title: 'AI-powered fix suggestions', desc: 'Get practical, easy to follow recommendations to fix identified issues.', }, ]; const STEPS = [ { title: 'Scan', desc: 'Choose a page and run an accessibility scan.' }, { title: 'Review', desc: 'See the score, issues and recommendations.' }, { title: 'Fix', desc: 'Make the suggested changes and rescan.' }, ]; function FeatureIcon({ variant }: { variant: 'score' | 'severity' | 'passed' | 'ai' }) { if (variant === 'score') { return A; } if (variant === 'severity') { return ( ); } if (variant === 'passed') { return ( ); } return ( ); } export default function OnboardingHero() { const { scanning, startScan } = useHeadlessScan(); const { data: urls = [] } = useQuery({ queryKey: ['scannable-urls', ''], queryFn: () => apiFetch('/scannable-urls'), }); const homepage = urls.find((u) => u.type === 'home'); const isScanning = !!(homepage && scanning[homepage.url]); return ( {/* ── Welcome banner ── */} Welcome to AccessMate Let’s check your accessibility Scan your pages for accessibility issues and get practical recommendations to make your website more inclusive. homepage && startScan(homepage.url)} disabled={!homepage || isScanning} aria-busy={isScanning} > {isScanning ? ( <> Scanning… > ) : ( <>Scan Homepage →> )} Learn more ↗ {/* ── Feature preview cards ── */} Your accessibility report will show you: {FEATURES.map((f) => ( {f.title} {f.desc} ))} {/* ── How it works ── */} How AccessMate works In just 3 simple steps, you can scan, review and improve your website. {STEPS.map((s, i) => ( {i + 1} {s.title} {s.desc} {i < STEPS.length - 1 && ( → )} ))} ); }
Scan your pages for accessibility issues and get practical recommendations to make your website more inclusive.
{f.desc}
In just 3 simple steps, you can scan, review and improve your website.
{s.desc}