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

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

export const Vercel: IconComponent<VercelProps> = React.forwardRef<
  SVGSVGElement,
  VercelProps
>(function Vercel(
  {
    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 123 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_2041_223)">
          <path
            d="M28.075 24L14.038 0L0.000976562 24H28.075ZM42.2329 22.9074L53.9638 1.09092H48.8898L40.7975 16.9348L32.7053 1.09092H27.6311L39.3621 22.9074H42.2329ZM122.179 1.09092V22.9075H117.978V1.09092H122.179ZM98.7954 14.7646C98.7954 13.0644 99.1564 11.569 99.8784 10.2784C100.6 8.98786 101.607 7.99431 102.898 7.29785C104.189 6.60134 105.698 6.25311 107.427 6.25311C108.958 6.25311 110.337 6.58085 111.562 7.23637C112.787 7.89189 113.761 8.86495 114.483 10.1555C115.205 11.4461 115.576 13.0234 115.598 14.8876V15.8401H103.226C103.314 17.1921 103.718 18.2574 104.44 19.0358C105.184 19.7937 106.18 20.1727 107.427 20.1727C108.214 20.1727 108.936 19.9679 109.593 19.5582C110.249 19.1484 110.741 18.5953 111.07 17.8988L115.369 18.2061C114.844 19.7425 113.859 20.9716 112.415 21.8934C110.971 22.8153 109.308 23.2762 107.427 23.2762C105.698 23.2762 104.189 22.9279 102.898 22.2314C101.607 21.535 100.6 20.5414 99.8784 19.2509C99.1564 17.9603 98.7954 16.4649 98.7954 14.7646ZM111.266 13.2282C111.113 11.8967 110.686 10.9237 109.986 10.3092C109.287 9.67412 108.433 9.35658 107.427 9.35658C106.267 9.35658 105.327 9.69457 104.605 10.3706C103.883 11.0466 103.434 11.9992 103.259 13.2282H111.266ZM91.7088 10.3092C92.4088 10.8622 92.8463 11.6304 93.0214 12.6137L97.3536 12.3986C97.2001 11.149 96.7518 10.0633 96.0082 9.14151C95.2641 8.21968 94.3012 7.51292 93.12 7.02129C91.9604 6.50917 90.6807 6.25311 89.2802 6.25311C87.5517 6.25311 86.0423 6.60134 84.7513 7.29785C83.4603 7.99431 82.4542 8.98786 81.7322 10.2784C81.0101 11.569 80.6491 13.0644 80.6491 14.7646C80.6491 16.4649 81.0101 17.9603 81.7322 19.2509C82.4542 20.5414 83.4603 21.535 84.7513 22.2314C86.0423 22.9279 87.5517 23.2762 89.2802 23.2762C90.7243 23.2762 92.0369 23.0201 93.2186 22.508C94.3998 21.9754 95.3626 21.2277 96.1063 20.2649C96.8504 19.3021 97.2987 18.1754 97.4518 16.8848L93.0871 16.7005C92.9341 17.7862 92.5074 18.6261 91.8074 19.2201C91.1069 19.7937 90.2647 20.0805 89.2802 20.0805C87.924 20.0805 86.8738 19.6196 86.1297 18.6978C85.386 17.7759 85.0137 16.4649 85.0137 14.7646C85.0137 13.0644 85.386 11.7534 86.1297 10.8315C86.8738 9.90969 87.924 9.44875 89.2802 9.44875C90.2211 9.44875 91.0304 9.73555 91.7088 10.3092ZM70.3988 6.62109H74.3076L74.4207 9.75549C74.6982 8.86828 75.0841 8.17929 75.5784 7.68854C76.2948 6.97689 77.2938 6.62109 78.575 6.62109H80.1712V9.97597H78.5426C77.6305 9.97597 76.8812 10.098 76.2948 10.3419C75.7301 10.5859 75.2958 10.9722 74.9921 11.5009C74.7094 12.0295 74.5686 12.7005 74.5686 13.5138V22.9074H70.3988V6.62109ZM52.368 10.2784C51.646 11.569 51.285 13.0644 51.285 14.7646C51.285 16.4649 51.646 17.9603 52.368 19.2509C53.0901 20.5414 54.0961 21.535 55.3872 22.2314C56.6782 22.9279 58.1875 23.2762 59.9161 23.2762C61.7977 23.2762 63.4606 22.8153 64.9046 21.8934C66.3483 20.9716 67.3332 19.7425 67.8581 18.2061L63.5587 17.8988C63.2305 18.5953 62.7385 19.1484 62.0822 19.5582C61.4259 19.9679 60.7039 20.1727 59.9161 20.1727C58.6692 20.1727 57.6735 19.7937 56.9298 19.0358C56.2078 18.2574 55.8031 17.1921 55.7153 15.8401H68.0876V14.8876C68.066 13.0234 67.6942 11.4461 66.9722 10.1555C66.2501 8.86495 65.2765 7.89189 64.0512 7.23637C62.8259 6.58085 61.4475 6.25311 59.9161 6.25311C58.1875 6.25311 56.6782 6.60134 55.3872 7.29785C54.0961 7.99431 53.0901 8.98786 52.368 10.2784ZM62.4761 10.3092C63.1761 10.9237 63.6028 11.8967 63.7559 13.2282H55.7482C55.9233 11.9992 56.3716 11.0466 57.0937 10.3706C57.8157 9.69457 58.7565 9.35658 59.9161 9.35658C60.9226 9.35658 61.7757 9.67412 62.4761 10.3092Z"
            fill="currentColor"
          />
        </g>
        <defs>
          <clipPath id="undefined-clip0_2041_223">
            <path fill="#fff" d="M0 0H123V24H0z" />
          </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}
      >
        <path d="M12 2L24 22.9721H0L12 2Z" fill="currentColor" />
      </svg>
    );
  }

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

Vercel.displayName = "Vercel";

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

export default Vercel;
