/* global React */
// Icon library, minimal SVGs used across the site.

const Icon = {
  // Brand logo, rendered from the official SVG. The artwork is sage-painted
  // by default but accepts an `invert` flag for use on dark backgrounds.
  Logo: ({ size = 40, invert = false }) => (
    <img
      src={invert ? "assets/logo-footer.svg" : "assets/logo-nav.svg"}
      alt="IOU Counseling"
      width={size}
      height={size * (67 / 59)}
      style={{ display: "block" }}
    />
  ),

  Leaf: () => (
    <svg viewBox="0 0 32 32" fill="none">
      <path
        d="M5 22 C 8 10, 18 5, 27 6 C 27 16, 22 25, 10 27 C 8 27, 6 25, 5 22 Z M 5 22 L 14 14"
        stroke="currentColor"
        strokeWidth="1.6"
        strokeLinecap="round"
        strokeLinejoin="round"
        fill="none"
      />
    </svg>
  ),

  Calendar: () => (
    <svg viewBox="0 0 16 16" width="14" height="14" fill="none">
      <rect x="1.5" y="3" width="13" height="11" rx="1.5" stroke="currentColor" strokeWidth="1.2" />
      <path d="M1.5 6.5 H 14.5" stroke="currentColor" strokeWidth="1.2" />
      <path d="M5 1.5 V 4.5 M11 1.5 V 4.5" stroke="currentColor" strokeWidth="1.2" strokeLinecap="round" />
    </svg>
  ),

  Clock: () => (
    <svg viewBox="0 0 16 16" width="14" height="14" fill="none">
      <circle cx="8" cy="8" r="6.5" stroke="currentColor" strokeWidth="1.2" />
      <path d="M8 4.5 V 8 L 10.5 9.5" stroke="currentColor" strokeWidth="1.2" strokeLinecap="round" />
    </svg>
  ),

  ArrowRight: () => (
    <svg viewBox="0 0 16 16" width="14" height="14" fill="none">
      <path d="M3 8 H 13 M9 4 L 13 8 L 9 12" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" />
    </svg>
  ),

  // Sigils for the IOU stages, rendered from the brand image set so they
  // exactly match the artwork in the Figma file. We let the image keep its
  // natural aspect ratio so the artwork is never squished; the wrapper just
  // bounds the maximum dimension via `max-width` / `max-height`.
  SigilInner: ({ size = 120 }) => (
    <img
      src="assets/sigil-innerstanding-snake.png"
      alt="InnerStanding sigil"
      style={{
        display: "block",
        maxWidth: size,
        maxHeight: size,
        width: "auto",
        height: "auto",
        objectFit: "contain"
      }}
    />
  ),

  SigilOver: ({ size = 120 }) => (
    <img
      src="assets/sigil-overstanding-flame.png"
      alt="OverStanding sigil"
      style={{
        display: "block",
        maxWidth: size,
        maxHeight: size,
        width: "auto",
        height: "auto",
        objectFit: "contain"
      }}
    />
  ),

  // UnderStanding uses the ouroboros snake artwork (no text). The asset is
  // already roughly square so it scales cleanly inside the wrapper.
  SigilUnder: ({ size = 120 }) => (
    <img
      src="assets/sigil-understanding.png"
      alt="UnderStanding sigil"
      style={{
        display: "block",
        maxWidth: size,
        maxHeight: size,
        width: "auto",
        height: "auto",
        objectFit: "contain"
      }}
    />
  ),

  // Decorative organic line (used in heros)
  Squiggle: ({ className }) => (
    <svg className={className} viewBox="0 0 800 600" fill="none" preserveAspectRatio="none">
      <path
        d="M -20 380 C 80 280, 200 320, 280 240 C 360 160, 460 200, 540 140 C 620 80, 720 120, 820 60"
        stroke="currentColor" strokeWidth="1" opacity="0.5" strokeLinecap="round"
      />
      <path
        d="M -20 460 C 100 380, 220 420, 320 360 C 400 320, 520 360, 600 280 C 680 220, 760 240, 820 200"
        stroke="currentColor" strokeWidth="1" opacity="0.3" strokeLinecap="round"
      />
    </svg>
  ),
};

window.Icon = Icon;
