"use client"; import React, { useState, useMemo } from "react"; import { TrendingDown, Activity, Settings2, BarChart3 } from "lucide-react"; import { cn } from "../utils/cn"; import { ComponentShareButton } from "./ComponentShareButton"; import { Reveal } from "./Reveal"; export function RevenueLossCalculator() { const [visitors, setVisitors] = useState(5000); const [conversionRate] = useState(2.0); const [orderValue, setOrderValue] = useState(150); const [loadTime, setLoadTime] = useState(4.0); const shareId = "revenue-loss-v1"; const LOSS_PER_SECOND = 0.07; const BASE_SPEED = 2.5; const results = useMemo(() => { const delay = Math.max(0, loadTime - BASE_SPEED); const dropFactor = 1 - (1 - LOSS_PER_SECOND) ** delay; const currentOrders = visitors * (conversionRate / 100); const currentRevenue = currentOrders * orderValue; const potentialRevenue = currentRevenue / (1 - dropFactor); const lostRevenue = potentialRevenue - currentRevenue; const lostOrders = (potentialRevenue - currentRevenue) / orderValue; return { lostRevenue: Math.round(lostRevenue), lostOrders: Math.round(lostOrders), potentialRevenue: Math.round(potentialRevenue), }; }, [visitors, conversionRate, orderValue, loadTime]); return (
{/* Ambient Glow */}
{/* Header */}

REVENUE_SIMULATOR

Performance x Conversion

LIVE_ENGINE
{/* Controls */}
{/* Traffic */}
Monatlicher Traffic
{visitors.toLocaleString()} VISITS
setVisitors(Number(e.target.value))} className="w-full h-1.5 bg-slate-100 rounded-full appearance-none outline-none [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-slate-800 [&::-webkit-slider-thumb]:rounded-full cursor-pointer hover:[&::-webkit-slider-thumb]:scale-110 [&::-webkit-slider-thumb]:transition-transform" />
{/* Order Value */}
Ø Kundenwert
€{orderValue.toLocaleString()}
setOrderValue(Number(e.target.value))} className="w-full h-1.5 bg-slate-100 rounded-full appearance-none outline-none [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-slate-800 [&::-webkit-slider-thumb]:rounded-full cursor-pointer hover:[&::-webkit-slider-thumb]:scale-110 [&::-webkit-slider-thumb]:transition-transform" />
{/* Load Time */}
Website Ladezeit 2.5 ? "bg-red-50 text-red-500" : "bg-emerald-50 text-emerald-500" )}> {loadTime > 2.5 ? "Kritisch > 2.5s" : "Optimal < 2.5s"}
2.5 ? "text-red-500" : "text-slate-900" )}> {loadTime.toFixed(1)}s
setLoadTime(Number(e.target.value))} className={cn("w-full h-1.5 rounded-full appearance-none outline-none [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:rounded-full cursor-pointer hover:[&::-webkit-slider-thumb]:scale-110 transition-all", loadTime > 2.5 ? "bg-red-100 [&::-webkit-slider-thumb]:border-red-500" : "bg-slate-100 [&::-webkit-slider-thumb]:border-slate-800" )} />
{/* Results */}
{/* Decorative Background Icon */}
Entgangener Umsatz (MTL.)
0 ? "text-red-500" : "text-slate-900" )}> €{results.lostRevenue.toLocaleString()}
Verlorene Leads (MTL.)
{results.lostOrders} Nutzer

REF: GOOGLE + AKAMAI_DATA
(0.07 DROP RATE PER SECOND)

); }