Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hocgin committed Sep 21, 2024
1 parent 2b57607 commit 721f88d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/_utils/kit.ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { message, Tree, TreeSelect, Upload } from 'antd';
import { StructKit } from '@/_utils';
import { FileInfo, TreeNode } from '@/_types';
import { SmileOutlined, HeartOutlined, HomeOutlined } from '@ant-design/icons';
import * as ICONS from '@ant-design/icons';

export default class UIKit {
public static COLUMN_PREFIX = 'hui.';
Expand Down Expand Up @@ -31,11 +31,10 @@ export default class UIKit {
*/
public static getIcon(name?: string): JSX.Element {
const IconMap: Record<string, any> = {
SmileOutlined: <SmileOutlined />,
HeartOutlined: <HeartOutlined />,
HomeOutlined: <HomeOutlined />,
default: ICONS['BuildOutlined'],
};
return IconMap[name || 'default'];
let Element = IconMap[name || 'default'];
return React.createElement(Element ?? ICONS[name], {});
}

/**
Expand Down

0 comments on commit 721f88d

Please sign in to comment.