choose to show which detail in each views

This commit is contained in:
daniel31x13
2024-08-26 19:56:04 -04:00
parent 9ae9c7c81a
commit 0371695eb3
7 changed files with 158 additions and 122 deletions
+3 -3
View File
@@ -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;