feat(wizard): allow deleting devices in step 4 summary and redirect home when empty

This commit is contained in:
DanielS
2026-08-11 23:20:55 +02:00
parent 982897a808
commit 386527a35c
2 changed files with 25 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ interface StepSummaryProps {
setOrderNotes: (notes: string) => void
onEditBasketItem?: (idx: number) => void
onAddNewBasketItem?: () => void
onDeleteBasketItem?: (idx: number) => void
}
function CategoryIcon({ icon, className }: { icon?: string | null; className?: string }) {
@@ -67,6 +68,7 @@ export function StepSummary({
setOrderNotes,
onEditBasketItem,
onAddNewBasketItem,
onDeleteBasketItem,
}: StepSummaryProps) {
return (
<div className="grid grid-cols-1 lg:grid-cols-12 gap-6 h-full items-stretch text-left">
@@ -206,6 +208,21 @@ export function StepSummary({
<Icons.Pencil className="w-3 h-3" /> Bearbeiten
</Button>
)}
{onDeleteBasketItem && (
<Button
type="button"
variant="ghost"
size="sm"
onClick={(e) => {
e.stopPropagation()
onDeleteBasketItem(itemIdx)
}}
className="h-7 px-2 text-xs text-slate-400 hover:text-red-400 hover:bg-red-500/20 gap-1 rounded-lg"
title="Kasse löschen"
>
<Icons.Trash2 className="w-3 h-3" /> Löschen
</Button>
)}
</div>
</div>