/** * FAQPage — now powered by The Sasquatch 🦧 * Instead of a static wall of text, we surface the AI guide * with FAQ context pre-loaded so users can ask anything. */ import { useEffect } from 'react'; import { useSeoMeta } from '@unhead/react'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { HelpCircle, MessageCircle, MapPin, Zap, Shield, Package } from 'lucide-react'; import { useTranslation } from '@/contexts/language'; // Quick FAQ chips — prime the conversation const FAQ_CHIPS = [ { label: 'settingsUi.faq.chip1Label', q: 'settingsUi.faq.chip1Q' }, { label: 'settingsUi.faq.chip2Label', q: 'settingsUi.faq.chip2Q' }, { label: 'settingsUi.faq.chip3Label', q: 'settingsUi.faq.chip3Q' }, { label: 'settingsUi.faq.chip4Label', q: 'settingsUi.faq.chip4Q' }, { label: 'settingsUi.faq.chip5Label', q: 'settingsUi.faq.chip5Q' }, { label: 'settingsUi.faq.chip6Label', q: 'settingsUi.faq.chip6Q' }, { label: 'settingsUi.faq.chip7Label', q: 'settingsUi.faq.chip7Q' }, { label: 'settingsUi.faq.chip8Label', q: 'settingsUi.faq.chip8Q' }, { label: 'settingsUi.faq.chip9Label', q: 'settingsUi.faq.chip9Q' }, { label: 'settingsUi.faq.chip10Label', q: 'settingsUi.faq.chip10Q' }, ]; const QUICK_FACTS = [ { icon: MapPin, color: '#ff0040', label: 'settingsUi.faq.fact1Label', value: 'settingsUi.faq.fact1Value' }, { icon: Zap, color: '#f97316', label: 'settingsUi.faq.fact2Label', value: 'settingsUi.faq.fact2Value' }, { icon: Shield, color: '#22c55e', label: 'settingsUi.faq.fact3Label', value: 'settingsUi.faq.fact3Value' }, { icon: Package, color: '#a855f7', label: 'settingsUi.faq.fact4Label', value: 'settingsUi.faq.fact4Value' }, ]; /** * Static answers. The page leans on The Sasquatch, but if the guide fails to * mount (or events are missed) the FAQ must still answer the basics itself. */ const STATIC_FAQ = [ { q: 'settingsUi.faq.s1Q', a: 'settingsUi.faq.s1A', }, { q: 'settingsUi.faq.s2Q', a: 'settingsUi.faq.s2A', }, { q: 'settingsUi.faq.s3Q', a: 'settingsUi.faq.s3A', }, { q: 'settingsUi.faq.s4Q', a: 'settingsUi.faq.s4A', }, { q: 'settingsUi.faq.s5Q', a: 'settingsUi.faq.s5A', }, { q: 'settingsUi.faq.s6Q', a: 'settingsUi.faq.s6A', }, ]; export default function FAQPage() { const { t } = useTranslation(); useSeoMeta({ title: t('settingsUi.faq.seoTitle'), description: t('settingsUi.faq.seoDescription'), }); // Open Sasquatch with FAQ context when this page loads useEffect(() => { // Dispatch a custom event that SasquatchGuide listens for const event = new CustomEvent('sasquatch:open', { detail: { context: 'faq', greeting: t('settingsUi.faq.greeting'), }, }); window.dispatchEvent(event); }, [t]); const askSasquatch = (question: string) => { const event = new CustomEvent('sasquatch:ask', { detail: { question } }); window.dispatchEvent(event); }; return ( <>
{t('settingsUi.faq.heroDesc')}
{t('settingsUi.faq.askDesc')}
{t(label)}
{t(value)}
{t(a)}
{t('settingsUi.faq.footerHint')}