diff --git a/packages/admin/admin-icons/package.json b/packages/admin/admin-icons/package.json index 4c85860890..141fa62780 100644 --- a/packages/admin/admin-icons/package.json +++ b/packages/admin/admin-icons/package.json @@ -22,6 +22,10 @@ "start:babel": "npx babel ./src -x \".ts,.tsx\" -d lib -w", "start:types": "tsc --project ./tsconfig.json --emitDeclarationOnly --watch --preserveWatchOutput" }, + "dependencies": { + "use-constant": "^1.0.0", + "uuid": "^9.0.0" + }, "devDependencies": { "@babel/cli": "^7.17.6", "@babel/core": "^7.20.12", @@ -32,6 +36,7 @@ "@types/node": "^18.0.0", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", + "@types/uuid": "^10.0.0", "cli-progress": "^3.8.2", "eslint": "^8.0.0", "fast-xml-parser": "^4.2.5", diff --git a/packages/admin/admin-icons/src/CometColor.tsx b/packages/admin/admin-icons/src/CometColor.tsx index 11b8f1ee8d..95eb36c016 100644 --- a/packages/admin/admin-icons/src/CometColor.tsx +++ b/packages/admin/admin-icons/src/CometColor.tsx @@ -1,23 +1,33 @@ import { SvgIcon, SvgIconProps } from "@mui/material"; +import useConstant from "use-constant"; +import { v4 as uuidv4 } from "uuid"; + +function getUniqueId() { + return `comet-icon-${uuidv4()}`; +} export default function Comet(props: SvgIconProps) { + const uniqueIdA = useConstant(getUniqueId); + const uniqueIdB = useConstant(getUniqueId); + const uniqueIdC = useConstant(getUniqueId); + return ( - + - - + + - +