/* 照野 — 图标（线性，currentColor） */

function Icon({ name, size = 18, stroke = 2 }) {
  const p = { width: size, height: size, viewBox: "0 0 24 24", fill: "none",
    stroke: "currentColor", strokeWidth: stroke, strokeLinecap: "round", strokeLinejoin: "round" };
  switch (name) {
    case "develop": // 显影：光圈
      return (<svg {...p}><circle cx="12" cy="12" r="8"/><path d="M12 4v5M20 12h-5M12 20v-5M4 12h5"/></svg>);
    case "waypoint": // 道标：未点燃的标记
      return (<svg {...p}><path d="M12 3v18"/><path d="M12 4l7 3-7 3"/></svg>);
    case "companion": // 同行：叠图
      return (<svg {...p}><circle cx="9" cy="12" r="6"/><circle cx="15" cy="12" r="6"/></svg>);
    case "now": // 此刻：锚点
      return (<svg {...p}><circle cx="12" cy="12" r="3"/><circle cx="12" cy="12" r="8" opacity="0.45"/><path d="M12 1v3M12 20v3M1 12h3M20 12h3"/></svg>);
    case "time": // 时间
      return (<svg {...p}><circle cx="12" cy="12" r="8"/><path d="M12 8v4l3 2"/></svg>);
    case "locate":
      return (<svg {...p}><circle cx="12" cy="12" r="3.2"/><path d="M12 2v3.5M12 18.5V22M2 12h3.5M18.5 12H22"/><circle cx="12" cy="12" r="7" opacity="0.4"/></svg>);
    case "search":
      return (<svg {...p}><circle cx="11" cy="11" r="6.5"/><path d="M20 20l-4-4"/></svg>);
    case "people":
      return (<svg {...p}><circle cx="9" cy="8" r="3.2"/><path d="M3.5 19c0-3 2.5-5 5.5-5s5.5 2 5.5 5"/><path d="M16 6.2a3 3 0 010 5.6M16.5 14c2.4.4 4 2.3 4 5"/></svg>);
    case "sliders":
      return (<svg {...p}><path d="M5 21V14M5 10V3M12 21V12M12 8V3M19 21v-5M19 12V3M2 14h6M9 8h6M16 16h6"/></svg>);
    case "close":
      return (<svg {...p}><path d="M6 6l12 12M18 6L6 18"/></svg>);
    case "chevL":
      return (<svg {...p}><path d="M15 5l-7 7 7 7"/></svg>);
    case "photo":
      return (<svg {...p} strokeWidth="1.6"><rect x="3" y="5" width="18" height="14" rx="2.5"/><circle cx="8.5" cy="10" r="1.8"/><path d="M3 16l5-4 4 3 3-2 6 5"/></svg>);
    default: return null;
  }
}

function StatusGlyphs() {
  return (
    <span className="r">
      <svg width="18" height="12" viewBox="0 0 18 12"><g fill="#fff">
        <rect x="0" y="7.5" width="3" height="4.5" rx=".6"/><rect x="4.5" y="5" width="3" height="7" rx=".6"/>
        <rect x="9" y="2.5" width="3" height="9.5" rx=".6"/><rect x="13.5" y="0" width="3" height="12" rx=".6"/>
      </g></svg>
      <svg width="16" height="12" viewBox="0 0 17 12" fill="#fff">
        <path d="M8.5 3.2C10.8 3.2 12.9 4.1 14.4 5.6L15.5 4.5C13.7 2.7 11.2 1.5 8.5 1.5C5.8 1.5 3.3 2.7 1.5 4.5L2.6 5.6C4.1 4.1 6.2 3.2 8.5 3.2Z"/>
        <path d="M8.5 6.8C9.9 6.8 11.1 7.3 12 8.2L13.1 7.1C11.8 5.9 10.2 5.1 8.5 5.1C6.8 5.1 5.2 5.9 3.9 7.1L5 8.2C5.9 7.3 7.1 6.8 8.5 6.8Z"/>
        <circle cx="8.5" cy="10.5" r="1.5"/></svg>
      <svg width="26" height="13" viewBox="0 0 27 13">
        <rect x=".5" y=".5" width="23" height="12" rx="3.5" stroke="#fff" strokeOpacity=".35" fill="none"/>
        <rect x="2" y="2" width="19" height="9" rx="2" fill="#fff"/>
        <path d="M25 4.5V8.5C25.8 8.2 26.5 7.2 26.5 6.5C26.5 5.8 25.8 4.8 25 4.5Z" fill="#fff" fillOpacity=".4"/></svg>
    </span>
  );
}

Object.assign(window, { Icon, StatusGlyphs });
