// screens.jsx — all screen components for the AnyInsu flow. Shared to window. const { useState, useEffect, useRef } = React; const LOGO = "https://www.anyinsu.com/wp-content/uploads/2021/03/anyinsu_logo_2-300x138.png"; /* ---------- shared chrome ---------- */ function Brand() { return ( AI ANYINSU ); } function TopBar({ onBack, hint }) { return (
{onBack ? : } {hint && {hint}}
); } const STEP_NAMES = ["본인확인", "보험 선택", "조건 입력", "산출 결과"]; function Stepper({ step }) { return ( <>
STEP {step}/4 · {STEP_NAMES[step - 1]}
{STEP_NAMES.map((_, i) => ( ))}
); } /* ---------- 0. HOME ---------- */ function FlipDigit({ d }) { const [cur, setCur] = useState(d); const [prev, setPrev] = useState(d); const [roll, setRoll] = useState(false); const liveRef = useRef(d); const timerRef = useRef(null); useEffect(() => { const target = d; if (liveRef.current === target) return; const step = () => { const from = liveRef.current; const next = (from + 1) % 10; liveRef.current = next; setPrev(from); setCur(next); setRoll(true); timerRef.current = setTimeout(() => { setRoll(false); if (next !== target) { timerRef.current = setTimeout(step, 12); } }, 165); }; clearTimeout(timerRef.current); step(); return () => clearTimeout(timerRef.current); }, [d]); return (
{cur}
{roll ? prev : cur}
{roll &&
{prev}
} {roll &&
{cur}
}
); } function FlipTile({ ch }) { return (
{ch}
{ch}
); } function FlipAmount() { const rand = () => (Math.floor(Math.random() * 5001) + 1000) * 100; // 100,000 ~ 600,000 (100원 단위) const [amt, setAmt] = useState(rand); useEffect(() => { const id = setInterval(() => { setAmt((p) => { let n; do { n = rand(); } while (n === p); return n; }); }, 3000); return () => clearInterval(id); }, []); const digits = String(amt).padStart(6, "0").split(""); return (
연 보험료
{digits.map((ch, i) => ( {i === 3 && ,} ))}
); } function Home({ onStart }) { return (
AI 실시간 보험료 산출

AI 분석으로
나에게 맞는 최적 보험,
지금 바로 확인하세요.

회원가입 없음 1분 소요 본인확인 안심

에니인슈는 믿고 맡기는 안전의 문화를 만들어 갑니다.

); } /* ---------- 1. 본인확인 ---------- */ function formatPhone(v) { const d = v.replace(/\D/g, "").slice(0, 11); if (d.length < 4) return d; if (d.length < 8) return d.slice(0, 3) + "-" + d.slice(3); return d.slice(0, 3) + "-" + d.slice(3, 7) + "-" + d.slice(7); } function Verify({ name, setName, phone, setPhone, onVerify, onBack }) { const digits = phone.replace(/\D/g, ""); const valid = name.trim().length >= 2 && digits.length >= 10; return (

본인확인이 필요해요

이름, 전화번호, 구글 계정으로
쉽고 빠르게 인증을 완료합니다.

setName(e.target.value)} />
setPhone(formatPhone(e.target.value))} />
Google 계정으로 안전하게 인증
입력하신 정보와 Google 계정을 통해 본인확인이 진행됩니다. 수집된 정보는 보험료 산출 및 상담 연결 목적으로만 사용됩니다.
); } /* ---------- 2. 보험 종류 선택 ---------- */ function SelectType({ name, onSelect, onConsult, onBack }) { return (
{name}님 본인확인 완료

어떤 보험이 필요하세요?

산출을 원하는 보험을 선택해 주세요.

또는
); } /* ---------- 3a. 화재보험 조건 ---------- */ const QUICK_PYEONG = [10, 20, 30, 50]; function FireForm({ industry, setIndustry, pyeong, setPyeong, onSubmit, onBack }) { const [customIndustry, setCustomIndustry] = useState(""); const valid = industry && Number(pyeong) > 0 && (industry !== "etc" || customIndustry.trim().length > 0); const m2 = Number(pyeong) > 0 ? (Number(pyeong) * PYEONG_TO_M2).toFixed(1) : null; return (

화재보험 산출 조건

업종과 사업장 면적을 입력하면
AI가 유사 계약을 분석해 예상 보험료를 산출해요.

{INDUSTRIES.map((ind) => ( ))}
{industry === "etc" && (
setCustomIndustry(e.target.value)} />
)}
setPyeong(e.target.value.replace(/[^0-9]/g, "").slice(0, 4))} />
{QUICK_PYEONG.map((p) => ( ))}
{m2 &&
약 {m2}㎡
}
); } /* ---------- 3b. 영업배상 ---------- */ const LIAB_OPTIONS = [ { id: "docs", icon: "doc", title: "구비서류 안내 요청", desc: "가입에 필요한 서류를 안내해 드려요. 담당자가 확인 후 연락드립니다." }, { id: "call", icon: "phone", title: "연락 바랍니다", desc: "담당자가 직접 연락드려 사업장에 맞는 보장을 상담해 드립니다." }, ]; function LiabilityForm({ choice, setChoice, onSubmit, onBack }) { return (
영업배상책임보험

어떻게 도와드릴까요?

영업배상은 조건이 다양해 담당자 상담으로 진행돼요.
원하시는 방식을 선택해 주세요.

{LIAB_OPTIONS.map((o) => ( ))}
); } /* ---------- 4a. 화재보험 결과 ---------- */ function FireResult({ result, name, onConsult, onRedo, onBack }) { const r = result; const [memo, setMemo] = useState(""); return (

{name}님의 예상 보험료

연 예상 보험료{r.premiumBasis === "similar" ? " · 실제 청약 기준" : ""}
{r.yearly.toLocaleString("ko-KR")}/년
월 환산 {wonPlain(r.monthly)}{r.premiumBasis === "similar" ? "" : " · 연 1.2% 할인 적용"}
{r.premiumBasis === "similar" ? "유사 청약 1건 기준 · 실제 보험료" : "AI 분석 · 유사 계약 기준 예상치"}
{r.similar ? ( <>
유사 계약 1건 비슷한 사업장은 이렇게 가입했어요
업종 {r.similar.industryName}
{r.similar.pyeong ? (
면적 {r.similar.pyeong}평약 {Math.round(r.similar.m2)}㎡
) : null} {r.similar.coverage ? (
가입금액 {wonPlain(r.similar.coverage)}
) : null} {r.similar.monthly ? (
실제 가입 보험료 {wonPlain(r.similar.yearly)} /년월 {wonPlain(r.similar.monthly)}
) : null} {r.similar.applyDate ? (
청약일 {r.similar.applyDate}
) : null}
) : (
비슷한 청약 사례를 찾지 못했어요. 담당자가 직접 정확히 산출해 드립니다.
)}

개인정보가 제거된 익명 유사 청약 사례이며, 실제 보험료는 가입 조건·보장 설계에 따라 달라질 수 있어요.