// A handful of line icons. 1.5 stroke on a 24 grid, round caps, currentColor.
const DH_ICONS = {
  arrowR: <path d="M4.5 12h15m-6-6 6 6-6 6" />,
  arrowUR: <path d="M7 17 17 7M8.5 7H17v8.5" />,
  arrowL: <path d="M19.5 12h-15m6-6-6 6 6 6" />,
  arrowD: <path d="M12 4.5v15m-6-6 6 6 6-6" />,
  close: <path d="M6 6l12 12M18 6 6 18" />,
  plus: <path d="M12 5v14M5 12h14" />,
  check: <path d="m5 12.5 4.5 4.5L19 7.5" />,
};

function Icon({ name, className = "", size, title }) {
  const d = DH_ICONS[name];
  if (!d) return null;
  return (
    <svg
      className={className}
      viewBox="0 0 24 24"
      width={size}
      height={size}
      fill="none"
      stroke="currentColor"
      strokeWidth="1.5"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden={title ? undefined : "true"}
      role={title ? "img" : undefined}
    >
      {title ? <title>{title}</title> : null}
      {d}
    </svg>
  );
}

window.Icon = Icon;
