'use client' import { Button } from '@/components/ui/button' import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog' import { Progress } from '@/components/ui/progress' import type { TransactionCategory } from '@/types' const expenseCategories: { value: TransactionCategory; label: string }[] = [ { value: 'expense_equipment', label: 'Utrustning' }, { value: 'expense_software', label: 'Programvara' }, { value: 'expense_travel', label: 'Resor' }, { value: 'expense_office', label: 'Kontor' }, { value: 'expense_marketing', label: 'Marknadsföring' }, { value: 'expense_professional_services', label: 'Konsulter' }, { value: 'expense_education', label: 'Utbildning' }, { value: 'expense_bank_fees', label: 'Bankavgift' }, { value: 'expense_card_fees', label: 'Kortavgift' }, { value: 'expense_currency_exchange', label: 'Valutaväxling' }, { value: 'expense_other', label: 'Övrigt' }, ] const incomeCategories: { value: TransactionCategory; label: string }[] = [ { value: 'income_services', label: 'Tjänster' }, { value: 'income_products', label: 'Produkter' }, { value: 'income_other', label: 'Övrigt' }, ] interface BatchCategorySelectorProps { open: boolean onOpenChange: (open: boolean) => void selectedCount: number onSelectCategory: (category: TransactionCategory) => void progress: { done: number; total: number } | null } export default function BatchCategorySelector({ open, onOpenChange, selectedCount, onSelectCategory, progress, }: BatchCategorySelectorProps) { const isProcessing = progress !== null return ( {isProcessing ? `Bokför ${progress.done}/${progress.total}...` : `Bokför ${selectedCount} transaktioner`} {isProcessing ? 'Vänta medan transaktionerna bokförs' : 'Välj en kategori som ska tillämpas på alla valda transaktioner'} {isProcessing ? (

{progress.done} av {progress.total} klara

) : (

Kostnader

{expenseCategories.map((cat) => ( ))}

Intäkter

{incomeCategories.map((cat) => ( ))}
)}
) }