improved iconPicker component + other improvements

This commit is contained in:
daniel31x13
2024-08-19 18:14:09 -04:00
parent 2893d3caf2
commit dc388ebba5
15 changed files with 222 additions and 72 deletions
+16
View File
@@ -0,0 +1,16 @@
import React, { forwardRef } from "react";
import * as Icons from "@phosphor-icons/react";
type Props = {
icon: string;
} & Icons.IconProps;
const Icon = forwardRef<SVGSVGElement, Props>(({ icon, ...rest }) => {
const IconComponent: any = Icons[icon as keyof typeof Icons];
if (!IconComponent) {
return <></>;
} else return <IconComponent {...rest} />;
});
export default Icon;