'use client' import Link from 'next/link' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { CheckCircle, XCircle, AlertCircle, FileText, ExternalLink, RotateCcw, } from 'lucide-react' import type { ImportResult } from '@/lib/import/types' interface ImportResultStepProps { result: ImportResult onNewImport: () => void } export default function ImportResultStep({ result, onNewImport }: ImportResultStepProps) { const hasErrors = result.errors.length > 0 const hasWarnings = result.warnings.length > 0 return (
{/* Success/Failure header */} {result.success ? ( <> Import genomförd ) : ( <> Import misslyckades )} {result.success ? 'Din bokföring har importerats framgångsrikt.' : 'Det uppstod fel under importen. Se detaljer nedan.'} {/* Statistics */} {result.success && (
Verifikationer skapade

{result.journalEntriesCreated}

Räkenskapsår
{result.fiscalPeriodId ? ( Skapat ) : ( Befintligt )}
Ingående balanser
{result.openingBalanceEntryId ? ( Importerade ) : ( Inga )}
)} {/* Errors */} {hasErrors && ( Fel ({result.errors.length})
{result.errors.map((error, i) => (
{error}
))}
)} {/* Warnings */} {hasWarnings && ( Varningar ({result.warnings.length})
{result.warnings.map((warning, i) => (
{warning}
))}
)} {/* Next steps */} {result.success && ( Nästa steg
1

Granska importerade verifikationer

Kontrollera att allt ser korrekt ut i bokföringslistan

2

Verifiera balanserna

Jämför huvudboken med din tidigare bokföring

3

Fortsätt med ny bokföring

Nu kan du börja lägga till nya transaktioner

)} {/* Actions */}
{result.success && ( <> )}
) }