import KFIcon from '@/components/KFIcon'; import KFModal from '@/components/KFModal'; import iconData from '@/iconfont/iconfont.json'; import { type ModalProps } from 'antd'; import { useEffect, useState } from 'react'; import styles from './index.less'; interface MenuIconSelectorProps extends Omit { selectedIcon?: string; onOk: (param: string) => void; } type IconObject = { icon_id: string; font_class: string; }; function MenuIconSelector({ open, selectedIcon, onOk, ...rest }: MenuIconSelectorProps) { const [icons, setIcons] = useState([]); useEffect(() => { const glyphs = iconData.glyphs as IconObject[]; setIcons(glyphs.filter((item) => !item.font_class.endsWith('-active'))); }, []); return (
{icons.map((icon) => (
onOk(icon.font_class)} >
))}
); } export default MenuIconSelector;