import { useState } from 'react'; import { LineChart, BarChart2, DollarSign, TrendingUp } from 'lucide-react'; export default function MarketingMixSimulator() { const [channels, setChannels] = useState({ tv: 30, social: 20, search: 25, email: 15, display: 10 }); const [baselineSales] = useState(1000000); // Simulated effectiveness coefficients const coefficients = { tv: 2.5, social: 1.8, search: 2.2, email: 1.5, display: 1.3 }; // Calculate impact on sales const calculateImpact = () => { return Object.entries(channels).reduce((total, [channel, spend]) => { return total + (spend * 10000 * coefficients[channel]); }, baselineSales); }; const totalSales = calculateImpact(); const roi = ((totalSales - baselineSales) / (Object.values(channels).reduce((a, b) => a + b, 0) * 10000) * 100).toFixed(1); const handleChange = (channel, value) => { setChannels(prev => ({ ...prev, [channel]: parseInt(value) })); }; return (
${(Object.values(channels).reduce((a, b) => a + b, 0) * 10000).toLocaleString()}
${totalSales.toLocaleString()}
{roi}%