/* チャットとAIエージェントの違い(営業資料v12 スライド9の図をWeb用に組み直したもの) 上下2段(人/AI)のレーンに4つの手順を置き、線でつなぐ。幅が狭いときは縦向きに切り替える。 使う場所:service-ai.html(AiWhatIs)・service-ai-agent.html(AiVsChat) */ const LANE_COLOR = { '人': { lane:'#eef1f6', dot:'#19448E' }, 'AI': { lane:'#f6efe2', dot:'#B07A2A' } }; const AI_LANE_CHAT = [ { who:'人', t:['人が仕事を受ける'] }, { who:'AI', t:['作業の一部を', 'チャットに頼む'] }, { who:'人', t:['AIの回答をもとに、', '人が仕上げる'] }, { who:'人', t:['人が相手に渡す'] } ]; const AI_LANE_AGENT = [ { who:'AI', t:['AIが仕事を受ける'] }, { who:'AI', t:['AIが作る'] }, { who:'人', t:['人が確認する'], hollow:true, dashedIn:true }, { who:'AI', t:['AIが相手に渡す'], dashedIn:true } ]; const useNarrow = (px) => { const get = () => typeof window !== 'undefined' && window.innerWidth < px; const [narrow, setNarrow] = React.useState(get()); React.useEffect(() => { const on = () => setNarrow(get()); window.addEventListener('resize', on); return () => window.removeEventListener('resize', on); }, []); return narrow; }; const LaneDot = ({ x, y, s, i }) => { const c = LANE_COLOR[s.who].dot; return ( {i + 1} ); }; /* 横向き:左にレーン名、右へ手順が進む */ const LaneWide = ({ steps }) => { const laneY = { '人':34, 'AI':94 }; const xs = [190, 400, 610, 820]; return ( s.t.join('')).join('、')} style={{display:'block', fontFamily:'var(--font-sans, sans-serif)'}}> 人 AI {steps.slice(1).map((s, i) => ( ))} {steps.map((s, i) => )} {steps.map((s, i) => s.t.map((line, j) => ( {line} )))} ); }; /* 縦向き(スマホ):上にレーン名、下へ手順が進み、右に説明 */ const LaneTall = ({ steps }) => { const laneX = { '人':40, 'AI':112 }; const rowH = 66; const ys = steps.map((_, i) => 64 + i * rowH); const h = ys[ys.length - 1] + 40; return ( s.t.join('')).join('、')} style={{display:'block', fontFamily:'var(--font-sans, sans-serif)'}}> 人 AI {steps.slice(1).map((s, i) => ( ))} {steps.map((s, i) => )} {steps.map((s, i) => s.t.map((line, j) => ( {line} )))} ); }; const AiLaneChart = ({ title, steps }) => { const narrow = useNarrow(720); return (

{title}

{narrow ? : }
); }; const AiLaneCompare = () => (
); Object.assign(window, { AiLaneChart, AiLaneCompare, AI_LANE_CHAT, AI_LANE_AGENT });