Add LICENSE (AGPL-3.0-or-later), CONTRIBUTING.md, SECURITY.md, DCO, and NOTICE files. Rewrite README for open-source audience with self-hosting instructions. Redesign color palette to grayscale chrome theme across all components. Add transaction uncategorize API route with tests. Fix VAT account name mismatches in migration 052. Improve import page with SIE file support and loading skeleton. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
64 lines
1.9 KiB
TypeScript
64 lines
1.9 KiB
TypeScript
'use client'
|
|
|
|
import {
|
|
Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter,
|
|
} from '@/components/ui/dialog'
|
|
import { Button } from '@/components/ui/button'
|
|
import { Loader2, AlertTriangle } from 'lucide-react'
|
|
|
|
interface ConfirmDeleteDialogProps {
|
|
open: boolean
|
|
onOpenChange: (open: boolean) => void
|
|
title?: string
|
|
description?: string
|
|
onConfirm: () => void | Promise<void>
|
|
isDeleting?: boolean
|
|
}
|
|
|
|
export default function ConfirmDeleteDialog({
|
|
open,
|
|
onOpenChange,
|
|
title = 'Bekrafta borttagning',
|
|
description = 'Ar du saker pa att du vill ta bort detta? Atgarden kan inte angras.',
|
|
onConfirm,
|
|
isDeleting = false,
|
|
}: ConfirmDeleteDialogProps) {
|
|
const handleConfirm = async () => {
|
|
await onConfirm()
|
|
onOpenChange(false)
|
|
}
|
|
|
|
return (
|
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
<DialogContent className="max-w-sm">
|
|
<DialogHeader>
|
|
<div className="flex items-center gap-3">
|
|
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10">
|
|
<AlertTriangle className="h-5 w-5 text-destructive" />
|
|
</div>
|
|
<div>
|
|
<DialogTitle>{title}</DialogTitle>
|
|
<DialogDescription>{description}</DialogDescription>
|
|
</div>
|
|
</div>
|
|
</DialogHeader>
|
|
<DialogFooter>
|
|
<Button variant="outline" onClick={() => onOpenChange(false)} disabled={isDeleting}>
|
|
Avbryt
|
|
</Button>
|
|
<Button variant="destructive" onClick={handleConfirm} disabled={isDeleting}>
|
|
{isDeleting ? (
|
|
<>
|
|
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
Tar bort...
|
|
</>
|
|
) : (
|
|
'Ta bort'
|
|
)}
|
|
</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
)
|
|
}
|