Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

441 B
Raw Blame
import { ComponentProps, ComponentType, SVGProps } from "react";

type VariantIcon = ComponentType<
  SVGProps<SVGSVGElement> & { variant?: "outline" | "fill" }
>;

export function withFillVariant(Icon: VariantIcon): VariantIcon {
  const FillIcon = (props: ComponentProps<VariantIcon>) => (
    <Icon variant="fill" {...props} />
  );
  FillIcon.displayName = `FillVariant(${Icon.displayName || Icon.name || "Icon"})`;
  return FillIcon;
}