Looking for a way to convert the code snippet below into cva format...
{items.map((item, index) => {
const isActive = item.key === SOMETHING;
return (
<div
key={index}
className={clsx(
`cursor-pointer`,
{
"text-white": isActive && variant === "inverted",
"text-stone-950": isActive && variant === "default",
"text-[#9b9b9b]": !isActive,
"hover:text-white": variant === "inverted",
"hover:text-stone-950": variant === "default",
},
)}
>...</div>
});
I have attempted the following approach -
const textContentCva = cva("", {
variants: {
variant: {
inverted: "hover:text-white",
default: "hover:text-stone-950",
},
},
});
However, I am unsure how to include the isActive variable.
Creating separate activeInverted and activeDefault variants doesn't seem optimal.
Can someone provide guidance on how to properly convert this code using cva?