'use client' import Link from 'next/link' import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from '@/components/ui/dialog' import { Button } from '@/components/ui/button' import { ExternalLink } from 'lucide-react' import { formatCurrency, formatDate } from '@/lib/utils' import type { AgentInboxItemView } from '@/app/(dashboard)/agent-inbox/page' interface Props { open: boolean onOpenChange: (open: boolean) => void tx: NonNullable } export default function TransactionDetailDialog({ open, onOpenChange, tx }: Props) { return ( {tx.description || 'Okänd transaktion'} {formatCurrency(tx.amount, tx.currency)} {formatDate(tx.date)} · Banktransaktion
{tx.merchant_name && tx.merchant_name !== tx.description && ( <>
Handlare
{tx.merchant_name}
)}
Kategori
{tx.category ?? '—'}
Affärs/privat
{tx.is_business === true ? 'Affärs' : tx.is_business === false ? 'Privat' : 'Okänt'}
{tx.currency && tx.currency !== 'SEK' && ( <>
Valuta
{tx.currency} {tx.amount_sek != null && ( {' '} ({formatCurrency(tx.amount_sek, 'SEK')}) )}
{tx.exchange_rate != null && ( <>
Växelkurs
{tx.exchange_rate}
)} {tx.exchange_rate_date && ( <>
Kursdatum
{formatDate(tx.exchange_rate_date)}
)} )} {tx.mcc_code != null && ( <>
MCC-kod
{tx.mcc_code}
)} {tx.external_id && ( <>
Externt ID
{tx.external_id}
)} {tx.bank_connection_id && ( <>
Bankanslutning
{tx.bank_connection_id.slice(0, 8)}…
)}
Transaktions-ID
{tx.id}
) }