import * as React from "react";
import type { IconProps, IconMetadata, IconComponent } from "../../types";

interface GithubProps extends IconProps {
  type?: "wordmark" | "icon";
}

export const Github: IconComponent<GithubProps> = React.forwardRef<
  SVGSVGElement,
  GithubProps
>(function Github(
  {
    color = "currentColor",
    fill,
    size = 24,
    strokeWidth,
    strokeLinecap,
    strokeLinejoin,
    strokeDasharray,
    opacity,
    className,
    type = "icon",
    ...props
  },
  forwardedRef,
) {
  if (type === "wordmark") {
    return (
      <svg
        width={size}
        height={size}
        viewBox="0 0 88 24"
        fill="none"
        xmlns="http://www.w3.org/2000/svg"
        className={className}
        strokeWidth={strokeWidth}
        strokeLinecap={strokeLinecap}
        strokeLinejoin={strokeLinejoin}
        strokeDasharray={strokeDasharray}
        opacity={opacity}
        {...props}
        ref={forwardedRef}
      >
        <g clipPath="url(#undefined-clip0_2011_440)">
          <path
            d="M36.5283 19.8753H36.493C36.493 19.8753 36.493 19.9108 36.5283 19.8753ZM36.5283 19.9108C36.3517 19.9108 35.8924 20.0175 35.3978 20.0175C33.8434 20.0175 33.3135 19.3064 33.3135 18.3819V12.1597H36.4576C36.6343 12.1597 36.7756 12.0175 36.7756 11.7686V8.39081C36.7756 8.21303 36.6343 8.07081 36.4576 8.07081H33.3135V3.87526C33.3135 3.73303 33.2075 3.62637 33.0309 3.62637H28.7917C28.615 3.62637 28.509 3.73303 28.509 3.87526V8.17748C28.509 8.17748 26.3541 8.71081 26.2128 8.74637C26.0715 8.78192 25.9655 8.92415 25.9655 9.06637V11.7686C25.9655 11.9819 26.1068 12.1597 26.2834 12.1597H28.4737V18.6664C28.4737 23.5019 31.8298 23.9997 34.1261 23.9997C35.1859 23.9997 36.4223 23.6797 36.6343 23.573C36.7403 23.5375 36.8109 23.3953 36.8109 23.253V20.2664C36.8109 20.0886 36.6696 19.9464 36.5283 19.9108ZM83.1955 15.5375C83.1955 11.9464 81.7471 11.4841 80.228 11.6264C79.0622 11.6975 78.1084 12.3019 78.1084 12.3019V19.2708C78.1084 19.2708 79.0622 19.9464 80.5106 19.9819C82.5596 20.053 83.1955 19.3419 83.1955 15.5375ZM88 15.2175C88 22.0086 85.8097 23.9641 81.9944 23.9641C78.7796 23.9641 77.0133 22.3286 77.0133 22.3286C77.0133 22.3286 76.9426 23.253 76.8366 23.3597C76.766 23.4664 76.6953 23.5019 76.554 23.5019H73.6218C73.4099 23.5019 73.2332 23.3597 73.2332 23.1819L73.2686 1.13748C73.2686 0.959701 73.4099 0.817479 73.5865 0.817479H77.7904C77.9671 0.817479 78.1084 0.959701 78.1084 1.13748L78.0731 8.56859C78.0731 8.56859 79.6981 7.50192 82.065 7.50192H82.1004C84.5026 7.53748 88 8.42637 88 15.2175ZM70.831 8.07081H66.6977C66.4857 8.07081 66.3798 8.21303 66.3798 8.46192V19.2353C66.3798 19.2353 65.2846 20.0175 63.8009 20.0175C62.3171 20.0175 61.8932 19.3419 61.8932 17.8486V8.42637C61.8932 8.24859 61.7519 8.10637 61.5753 8.10637H57.3713C57.1947 8.10637 57.0534 8.24859 57.0534 8.42637V18.5597C57.0534 22.933 59.491 23.9997 62.8117 23.9997C65.5672 23.9997 67.7929 22.4708 67.7929 22.4708C67.7929 22.4708 67.8988 23.253 67.9342 23.3597C67.9695 23.4664 68.1108 23.5375 68.2521 23.5375H70.9016C71.1136 23.5375 71.2196 23.3953 71.2196 23.2175L71.2549 8.39081C71.1843 8.21303 71.043 8.07081 70.831 8.07081ZM24.1285 8.03526H19.9245C19.7479 8.03526 19.6066 8.21303 19.6066 8.42637V22.9686C19.6066 23.3597 19.8539 23.5019 20.2071 23.5019H23.9872C24.3758 23.5019 24.4817 23.3241 24.4817 22.9686V8.39081C24.4464 8.21303 24.3051 8.03526 24.1285 8.03526ZM22.0442 1.35081C20.5251 1.35081 19.324 2.5597 19.324 4.08859C19.324 5.61748 20.5251 6.82637 22.0442 6.82637C23.5279 6.82637 24.729 5.61748 24.729 4.08859C24.729 2.5597 23.5279 1.35081 22.0442 1.35081ZM54.5452 0.853035H50.3766C50.1999 0.853035 50.0586 0.995257 50.0586 1.17303V9.2797H43.5231V1.17303C43.5231 0.995257 43.3818 0.853035 43.2051 0.853035H39.0012C38.8246 0.853035 38.6833 0.995257 38.6833 1.17303V23.2175C38.6833 23.3953 38.8599 23.5375 39.0012 23.5375H43.2051C43.3818 23.5375 43.5231 23.3953 43.5231 23.2175V13.7953H50.0586L50.0233 23.2175C50.0233 23.3953 50.1646 23.5375 50.3412 23.5375H54.5452C54.7218 23.5375 54.8631 23.3953 54.8631 23.2175V1.17303C54.8631 0.995257 54.7218 0.853035 54.5452 0.853035ZM17.3456 10.5953V21.973C17.3456 22.0441 17.3103 22.1864 17.2397 22.2219C17.2397 22.2219 14.7668 23.9997 10.7041 23.9997C5.82898 23.9997 0 22.4708 0 12.2664C0 2.09748 5.08711 -0.035854 10.0329 -0.000298442C14.3428 -0.000298442 16.0739 0.959701 16.3212 1.13748C16.3918 1.24415 16.4271 1.31526 16.4271 1.42192L15.6146 4.94192C15.6146 5.1197 15.438 5.33303 15.226 5.26192C14.5195 5.04859 13.4597 4.62192 10.9514 4.62192C8.0546 4.62192 4.94581 5.4397 4.94581 12.0175C4.94581 18.5953 7.91329 19.3419 10.0329 19.3419C11.8346 19.3419 12.5058 19.1286 12.5058 19.1286V14.613H9.60899C9.39703 14.613 9.22039 14.4708 9.22039 14.293V10.5953C9.22039 10.4175 9.3617 10.2753 9.60899 10.2753H16.9924C17.2043 10.2753 17.3456 10.4175 17.3456 10.5953Z"
            fill="currentColor"
          />
        </g>
        <defs>
          <clipPath id="undefined-clip0_2011_440">
            <path fill="#fff" d="M0 0H88V24H0z" />
          </clipPath>
        </defs>
      </svg>
    );
  }

  if (type === "icon") {
    return (
      <svg
        width={size}
        height={size}
        viewBox="0 0 24 24"
        fill="none"
        xmlns="http://www.w3.org/2000/svg"
        className={className}
        strokeWidth={strokeWidth}
        strokeLinecap={strokeLinecap}
        strokeLinejoin={strokeLinejoin}
        strokeDasharray={strokeDasharray}
        opacity={opacity}
        {...props}
        ref={forwardedRef}
      >
        <g clipPath="url(#undefined-clip0_2039_482)">
          <path
            d="M12 0C5.37 0 0 5.37 0 12C0 17.31 3.435 21.795 8.205 23.385C8.805 23.49 9.03 23.13 9.03 22.815C9.03 22.53 9.015 21.585 9.015 20.58C6 21.135 5.22 19.845 4.98 19.17C4.845 18.825 4.26 17.76 3.75 17.475C3.33 17.25 2.73 16.695 3.735 16.68C4.68 16.665 5.355 17.55 5.58 17.91C6.66 19.725 8.385 19.215 9.075 18.9C9.18 18.12 9.495 17.595 9.84 17.295C7.17 16.995 4.38 15.96 4.38 11.37C4.38 10.065 4.845 8.985 5.61 8.145C5.49 7.845 5.07 6.615 5.73 4.965C5.73 4.965 6.735 4.65 9.03 6.195C9.99 5.925 11.01 5.79 12.03 5.79C13.05 5.79 14.07 5.925 15.03 6.195C17.325 4.635 18.33 4.965 18.33 4.965C18.99 6.615 18.57 7.845 18.45 8.145C19.215 8.985 19.68 10.05 19.68 11.37C19.68 15.975 16.875 16.995 14.205 17.295C14.64 17.67 15.015 18.39 15.015 19.515C15.015 21.12 15 22.41 15 22.815C15 23.13 15.225 23.505 15.825 23.385C20.565 21.795 24 17.295 24 12C24 5.37 18.63 0 12 0Z"
            fill="currentColor"
            fillRule="evenodd"
            clipRule="evenodd"
          />
        </g>
        <defs>
          <clipPath id="undefined-clip0_2039_482">
            <path fill="#fff" d="M0 0H24V24H0z" />
          </clipPath>
        </defs>
      </svg>
    );
  }

  console.error(`Github doesn't support ${type}`);
  return null;
});

Github.displayName = "Github";

Github.metadata = {
  name: "Github",
  category: "wordmark/software",
  tags: ["github", "icon"],
  description: "Github icon from wordmark/software category",
  type: ["stroke", "icon"],
} as IconMetadata;

export default Github;
