switch case styled components
import { Feather } from '@expo/vector-icons';
type IconProps = {
type: "up" | "down" | "total";
}
const handleColorType = ({ type }: IconProps ) => {
switch (type) {
case "up":
return '#12A454';
case "down":
return '#E83F5B';
case "total":
return '#363F5F';
default:
return "#fff";
}
};
export const Icon = styled(Feather) <IconProps>`
color: ${({ type }) => handleColorType({ type })}
`;