'use client' import { useAos } from '@/store/aos' import { Card, CardContent } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { Progress } from '@/components/ui/progress' import { Check, ChevronRight, Rocket } from 'lucide-react' import { cn } from '@/lib/utils' import { useI18n } from '@/hooks/use-i18n' const CHECKLIST_ITEMS = [ { key: 'visit_leads', view: 'leads', label_de: 'Leads Finder erkunden', label_en: 'Explore Leads Finder', label_tr: 'Leads Finder keşfet' }, { key: 'visit_projects', view: 'projects', label_de: 'Projekte ansehen', label_en: 'View Projects', label_tr: 'Projeleri görüntüle' }, { key: 'visit_finance', view: 'finance', label_de: 'Rechnungen prüfen', label_en: 'Check Invoices', label_tr: 'Faturaları kontrol et' }, { key: 'visit_accounting', view: 'accounting', label_de: 'Buchhaltung (UStVA) ansehen', label_en: 'View Accounting (VAT)', label_tr: 'Muhasebeyi (KDV) görüntüle' }, { key: 'visit_api', view: 'api', label_de: 'API-Token erstellen', label_en: 'Create API Token', label_tr: 'API Token oluştur' }, { key: 'visit_portal', view: 'dashboard', label_de: 'Client-Portal öffnen', label_en: 'Open Client Portal', label_tr: 'Müşteri Portalını aç' }, ] as const export function OnboardingChecklist() { const { checklist, toggleChecklist, setView, setPortalMode } = useAos() const { locale } = useI18n() const completed = CHECKLIST_ITEMS.filter((item) => checklist[item.key]).length const total = CHECKLIST_ITEMS.length const pct = Math.round((completed / total) * 100) const allDone = completed === total const label = (item: typeof CHECKLIST_ITEMS[number]) => { if (locale === 'en') return item.label_en if (locale === 'tr') return item.label_tr return item.label_de } const go = (item: typeof CHECKLIST_ITEMS[number]) => { if (item.view === 'dashboard' && item.key === 'visit_portal') { setPortalMode(true) } else { setView(item.view as 'leads' | 'projects' | 'finance' | 'accounting' | 'api' | 'dashboard') } if (!checklist[item.key]) toggleChecklist(item.key) } if (allDone) { return (

Onboarding abgeschlossen!

Du kennst nun alle Kernfunktionen. Bei Fragen sieh im Handbuch (Wissensdatenbank) nach.

) } return (
Onboarding-Checkliste {completed}/{total}
{pct}%
{CHECKLIST_ITEMS.map((item) => { const done = checklist[item.key] return ( ) })}
) }