feat(shop): add dynamic linked fees to modules

This commit is contained in:
DanielS
2026-07-22 15:09:05 +02:00
parent acd8d6575c
commit 1c31918768
8 changed files with 208 additions and 21 deletions

View File

@@ -28,6 +28,7 @@ interface StepSummaryProps {
isSubmitting: boolean
initialOrder: any
prevStep: () => void
linkedFeeProducts?: Product[]
}
function CategoryIcon({ icon, className }: { icon?: string | null; className?: string }) {
@@ -56,6 +57,7 @@ export function StepSummary({
isSubmitting,
initialOrder,
prevStep,
linkedFeeProducts = [],
}: StepSummaryProps) {
return (
<Card className="glass-dark border-primary/30 max-w-2xl mx-auto shadow-primary/10 shadow-2xl">
@@ -142,6 +144,30 @@ export function StepSummary({
})}
</div>
))}
{linkedFeeProducts && linkedFeeProducts.length > 0 && (
<div className="space-y-3 border-b border-white/10 pb-4 last:border-0 last:pb-0">
<div className="flex justify-between items-center bg-white/5 p-2 rounded">
<span className="text-white font-bold text-sm">Zusätzliche Dienste & Gebühren</span>
<span className="text-xs text-slate-400">Einmalig berechnet</span>
</div>
{linkedFeeProducts.map(p => (
<div key={p.id} className="pl-2 space-y-1">
<div className="flex justify-between font-semibold text-sm text-white pl-3">
<span>{p.name}</span>
<span>
{new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(p.base_price)}
{' '}<span className="text-slate-400 text-[10px] font-normal">{p.billing_interval === 'monthly' ? '/ mtl.' : 'einmalig'}</span>
</span>
</div>
{p.description && (
<p className="text-xs text-slate-400 mt-0.5 pl-3">
{p.description}
</p>
)}
</div>
))}
</div>
)}
<Separator className="bg-white/10" />
<div className="text-sm text-slate-300 space-y-1">
{selectedEndCustomer ? (