'use client'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Button } from '@/components/ui/button'
import { Badge } from '@/components/ui/badge'
import { Skeleton } from '@/components/ui/skeleton'
import { ArrowRight } from 'lucide-react'
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '@/components/ui/table'
import { formatCurrency } from '@/lib/utils'
import type { YearEndPreview } from '@/types'
interface PreviewStepProps {
preview: YearEndPreview | null
isLoading: boolean
error: string | null
onBack: () => void
onContinue: () => void
}
export function PreviewStep({ preview, isLoading, error, onBack, onContinue }: PreviewStepProps) {
if (isLoading) {
return (
{error}
Nettoresultat överförs till {preview.closingAccount} {preview.closingAccountName}
{isProfit &&{formatCurrency(preview.netResult)}
Öppna fordringar/skulder i utländsk valuta värderas om till balansdagens kurs innan bokslut. Detta sker automatiskt som en del av verkställandet.
Kursvinst
{formatCurrency(preview.currencyRevaluation.totalGain)}
Kursförlust
{formatCurrency(preview.currencyRevaluation.totalLoss)}
Nettoeffekt
{formatCurrency(preview.currencyRevaluation.netEffect)}
{preview.closingLines.length} kontorader. Nollställer klass 3–8 mot {preview.closingAccount}.