'init_again'
Change-Id: Ib7ecdb9f5baeab1e4681152a57b936edf7475b35
diff --git a/src/utils/IconUtil.ts b/src/utils/IconUtil.ts
new file mode 100644
index 0000000..31102ee
--- /dev/null
+++ b/src/utils/IconUtil.ts
@@ -0,0 +1,20 @@
+import * as AntdIcons from '@ant-design/icons';
+import React from 'react';
+
+const allIcons: Record<string, any> = AntdIcons;
+
+export function getIcon(name: string): React.ReactNode | string {
+ const icon = allIcons[name];
+ return icon || '';
+}
+
+export function createIcon(icon: string | any): React.ReactNode | string {
+ if (typeof icon === 'object') {
+ return icon;
+ }
+ const ele = allIcons[icon];
+ if (ele) {
+ return React.createElement(allIcons[icon]);
+ }
+ return '';
+}