choose to show which detail in each views
This commit is contained in:
+3
-3
@@ -5,12 +5,12 @@ type Props = {
|
||||
icon: string;
|
||||
} & Icons.IconProps;
|
||||
|
||||
const Icon = forwardRef<SVGSVGElement, Props>(({ icon, ...rest }) => {
|
||||
const Icon = forwardRef<SVGSVGElement, Props>(({ icon, ...rest }, ref) => {
|
||||
const IconComponent: any = Icons[icon as keyof typeof Icons];
|
||||
|
||||
if (!IconComponent) {
|
||||
return <></>;
|
||||
} else return <IconComponent {...rest} />;
|
||||
return null;
|
||||
} else return <IconComponent ref={ref} {...rest} />;
|
||||
});
|
||||
|
||||
export default Icon;
|
||||
|
||||
Reference in New Issue
Block a user