import React, { useMemo } from "react"; import { Check, Package as PackageIcon } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { useCheckoutWizard } from "../WizardContext"; import type { CheckoutPackage } from "../types"; const currencyFormatter = new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR", minimumFractionDigits: 2, }); function PackageSummary({ pkg }: { pkg: CheckoutPackage }) { return ( {pkg.name} {pkg.description}
{pkg.price === 0 ? "Kostenlos" : currencyFormatter.format(pkg.price)} {pkg.type === "reseller" ? "Reseller" : "Endkunde"}
{Array.isArray(pkg.features) && pkg.features.length > 0 && ( )}
); } function PackageOption({ pkg, isActive, onSelect }: { pkg: CheckoutPackage; isActive: boolean; onSelect: () => void }) { return ( ); } export const PackageStep: React.FC = () => { const { selectedPackage, packageOptions, setSelectedPackage, resetPaymentState, nextStep } = useCheckoutWizard(); const comparablePackages = useMemo(() => { return packageOptions.filter((pkg) => pkg.type === selectedPackage.type); }, [packageOptions, selectedPackage.type]); const handlePackageChange = (pkg: CheckoutPackage) => { if (pkg.id === selectedPackage.id) { return; } setSelectedPackage(pkg); resetPaymentState(); }; return (
); };