I have an icon component that takes a certain variant of an icon name and returns the result.
<Icon variant="add" />
I get possible component types like this
type IconProps = React.ComponentProps<typeof Icon>;
// IconProps["variant"] = "add"| "remove" | "plus" | "minus"
How do I check the name of an icon in a component? For example:
<Icon variant={"download" in IconProps["variant"] ? "download" : "add"} />