'use client' import { motion } from 'framer-motion' import { Language, PitchProduct } from '@/lib/types' import { t } from '@/lib/i18n' import GradientText from '../ui/GradientText' import FadeInView from '../ui/FadeInView' import GlassCard from '../ui/GlassCard' import { DollarSign, Repeat, TrendingUp } from 'lucide-react' interface BusinessModelSlideProps { lang: Language products: PitchProduct[] } const AMORT_MONTHS = 24 function computeKPIs(products: PitchProduct[]) { if (!products.length) return { weightedMarginDuring: 0, weightedMarginAfter: 0, amortMonths: AMORT_MONTHS } // Compute weighted margin based on product mix (equal weight per product as proxy) const n = products.length let sumMarginDuring = 0 let sumMarginAfter = 0 let maxAmortMonths = 0 for (const p of products) { const price = p.monthly_price_eur if (price <= 0) continue const amort = p.hardware_cost_eur > 0 ? p.hardware_cost_eur / AMORT_MONTHS : 0 const opex = p.operating_cost_eur > 0 ? p.operating_cost_eur : 0 // Margin during amortization const marginDuring = (price - amort - opex) / price sumMarginDuring += marginDuring // Margin after amortization (no more HW cost) const marginAfter = (price - opex) / price sumMarginAfter += marginAfter // Payback period in months if (p.hardware_cost_eur > 0 && price - opex > 0) { const payback = Math.ceil(p.hardware_cost_eur / (price - opex)) if (payback > maxAmortMonths) maxAmortMonths = payback } } return { weightedMarginDuring: Math.round((sumMarginDuring / n) * 100), weightedMarginAfter: Math.round((sumMarginAfter / n) * 100), amortMonths: maxAmortMonths || AMORT_MONTHS, } } export default function BusinessModelSlide({ lang, products }: BusinessModelSlideProps) { const i = t(lang) const { weightedMarginDuring, weightedMarginAfter, amortMonths } = computeKPIs(products) return (

{i.businessModel.title}

{i.businessModel.subtitle}

{/* Key Metrics — dynamisch berechnet */}

{i.businessModel.recurringRevenue}

100%

SaaS / Subscription

{i.businessModel.margin}

>{weightedMarginAfter}%

{lang === 'de' ? 'nach Amortisation' : 'post amortization'} {' · '} {weightedMarginDuring}% {lang === 'de' ? 'waehrend' : 'during'}

{i.businessModel.amortization}

{amortMonths} {i.businessModel.months}

{lang === 'de' ? 'max. Hardware-Amortisation' : 'max. Hardware Amortization'}

{/* Unit Economics per Product */}

{i.businessModel.unitEconomics}

{products.map((p, idx) => { const amort = p.hardware_cost_eur > 0 ? Math.round(p.hardware_cost_eur / AMORT_MONTHS) : 0 const monthlyMargin = p.monthly_price_eur - amort - (p.operating_cost_eur > 0 ? p.operating_cost_eur : 0) const marginPct = Math.round((monthlyMargin / p.monthly_price_eur) * 100) return (

{p.name}

{lang === 'de' ? 'Monatspreis' : 'Monthly Price'} {p.monthly_price_eur} EUR
{p.hardware_cost_eur > 0 && (
{i.businessModel.hardwareCost} -{amort} EUR/Mo
)} {p.operating_cost_eur > 0 && (
{i.businessModel.operatingCost} -{p.operating_cost_eur} EUR/Mo
)}
{i.businessModel.margin} 0 ? 'text-green-400' : 'text-red-400'}`}> {marginPct > 0 ? '+' : ''}{monthlyMargin} EUR ({marginPct}%)
) })}
) }