const { useState: useStateCalc, useMemo } = React; const SETUP_COST = 0; const ACCURACY = 80; function Calculator() { const [ops, setOps] = useStateCalc(5); const [salary, setSalary] = useStateCalc(45); const [requests, setRequests] = useStateCalc(200); const [typical, setTypical] = useStateCalc(65); const [hasNight, setHasNight] = useStateCalc(false); const calc = useMemo(() => { const totalMsgMonth = requests * 30; const typicalMsg = totalMsgMonth * typical / 100; const botMsgMonth = Math.round(typicalMsg * ACCURACY / 100); let botCost; if (botMsgMonth <= 2000) botCost = 10000; else if (botMsgMonth <= 10000) botCost = 30000; else if (botMsgMonth <= 50000) botCost = 50000; else botCost = Math.min(100000, 50000 + (botMsgMonth - 50000) * 1); const freedOps = +(ops * (typical / 100) * (ACCURACY / 100)).toFixed(1); const savingOps = Math.round(freedOps * salary * 1000); const nightSaving = hasNight ? 0 : Math.round(ops * 0.25 * (typical / 100) * (ACCURACY / 100) * salary * 1000); const grossSaving = savingOps + nightSaving; const netSaving = Math.max(0, grossSaving - botCost - SETUP_COST); const nightMsgMonth = hasNight ? 0 : Math.round(requests * 0.20 * 30); let roiLabel; const roiDaysRaw = grossSaving > 0 ? Math.round((botCost + SETUP_COST) / grossSaving * 30) : 999; if (netSaving <= 0) roiLabel = '—'; else if (roiDaysRaw < 30) roiLabel = `~${roiDaysRaw} дней`; else if (roiDaysRaw <= 90) roiLabel = `~${Math.round(roiDaysRaw / 30)} мес`; else roiLabel = '—'; return { botMsgMonth, totalMsgMonth, nightMsgMonth, freedOps, grossSaving, netSaving, botCost, roiLabel }; }, [ops, salary, requests, typical, hasNight]); const h = { big: calc.grossSaving.toLocaleString('ru-RU'), unit: '₽ в месяц', label: 'Высвобождено от типовых запросов' }; const formatNum = (n) => n.toLocaleString('ru-RU'); return (
Сколько ресурса высвободит бот

Подставьте свои цифры и посмотрите, что получится.

Операторов поддержки {ops}
setOps(+e.target.value)} className="calc-slider"/>
Зарплата оператора, ₽/мес {formatNum(salary * 1000)} ₽
setSalary(+e.target.value)} className="calc-slider"/>
Сообщений в день {requests}
setRequests(+e.target.value)} className="calc-slider"/>
% типовых вопросов {typical}%
setTypical(+e.target.value)} className="calc-slider"/>
Бот закроет в месяц
{formatNum(calc.botMsgMonth)}
сообщений из {formatNum(calc.totalMsgMonth)} в месяц
{h.label}
{h.big} {h.unit}
с учётом подписки · высвобождение ~{calc.freedOps} операторов
Окупаемость
{calc.roiLabel}
{!hasNight && (
+{formatNum(calc.nightMsgMonth)} ночных обращений теперь получат ответ
)}
Получить детальный расчёт
); } window.Calculator = Calculator;