import { BRAND_ICONS, STROKE_ICONS } from "../../shared/shareIcons";

/** 18 px logo for a "Share via" item: brand (filled) or stroke icon. */
export function NetworkIcon({ name }) {
  const brand = BRAND_ICONS[name];

  if (brand) {
    return (
      <svg
        className="pcfw-share__icon"
        aria-hidden="true"
        width="18"
        height="18"
        viewBox="0 0 24 24"
        fill={brand.color}
      >
        <path d={brand.path} />
      </svg>
    );
  }

  return (
    <svg
      className="pcfw-share__icon"
      aria-hidden="true"
      width="18"
      height="18"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round"
    >
      <path d={STROKE_ICONS[name]} />
    </svg>
  );
}
