'use client' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table' import { ArrowLeft, ArrowRight, AlertTriangle, Calendar, TrendingUp, TrendingDown, FileText, } from 'lucide-react' import { formatCurrency } from '@/lib/utils' import type { BankFileParseResult } from '@/lib/import/bank-file/types' interface BankFilePreviewStepProps { parseResult: BankFileParseResult onContinue: () => void onBack: () => void } export default function BankFilePreviewStep({ parseResult, onContinue, onBack, }: BankFilePreviewStepProps) { const { transactions, stats, issues, date_from, date_to } = parseResult const hasIssues = issues.filter((i) => i.severity === 'error').length > 0 const warnings = issues.filter((i) => i.severity === 'warning') return (
{stats.parsed_rows}
{stats.skipped_rows > 0 && ({stats.skipped_rows} rader hoppades över
)}{date_from || '–'} till {date_to || '–'}
{formatCurrency(stats.total_income)}
{formatCurrency(stats.total_expenses)}
Rad {issue.row}: {issue.message}
))} {warnings.length > 10 && (...och {warnings.length - 10} till
)}Visar 50 av {transactions.length} transaktioner
)}Filen innehåller fel som förhindrar import
Kontrollera felet ovan och försök ladda upp en korrigerad fil.