import React, { useState, useEffect, useRef } from "react"; const formatWon = (n) => { if (Math.abs(n) >= 100000000) return `${(n / 100000000).toFixed(1)}억`; if (Math.abs(n) >= 10000) return `${Math.round(n / 10000).toLocaleString()}만원`; return `${Math.round(n).toLocaleString()}원`; }; const formatWonFull = (n) => `${Math.round(n).toLocaleString()}원`; function AnimatedNumber({ value, duration = 1000 }) { const [display, setDisplay] = useState(0); const start = useRef(0); const startTime = useRef(null); const raf = useRef(null); useEffect(() => { start.current = display; startTime.current = null; const animate = (ts) => { if (!startTime.current) startTime.current = ts; const progress = Math.min((ts - startTime.current) / duration, 1); const ease = 1 - Math.pow(1 - progress, 4); setDisplay(Math.round(start.current + (value - start.current) * ease)); if (progress < 1) raf.current = requestAnimationFrame(animate); }; raf.current = requestAnimationFrame(animate); return () => cancelAnimationFrame(raf.current); }, [value]); return {display.toLocaleString()}; } const steps = [ { id: 1, label: "현재 직장", icon: "🏢" }, { id: 2, label: "이직 제안", icon: "🚀" }, { id: 3, label: "결과 분석", icon: "📊" }, ]; const InputField = ({ label, value, onChange, unit = "만원", hint }) => (
{hint}
}연봉만 보면 안 됩니다. 통근·복지·퇴직금까지 실질 손익 계산
표면적 연봉 차이
0 ? "#00d4aa" : "#ff6b6b", fontFamily: "monospace" }}> {(offer.salary - current.salary) > 0 ? "+" : ""}{(offer.salary - current.salary).toLocaleString()}만원
{isGood ? "이직 유리 판정" : "이직 불리 판정"}
연간 실질 {isGood ? "이득" : "손해"}: {formatWon(Math.abs(totalBenefitYear))}
항목별 분석
이직이 유리하다면, 이력서부터 준비해보세요
원티드 · 사람인 · 리멤버에서 무료로 시작
※ 추정치입니다. 실제 세금·퇴직금 산정과 다를 수 있습니다.