| import * as React from 'react'; |
| import CopyableIcon from './CopyableIcon'; |
| import type { ThemeType } from './index'; |
| import type { CategoriesKeys } from './fields'; |
| import { useIntl } from '@umijs/max'; |
| import styles from './style.less'; |
| interface CategoryProps { |
| onSelect: (type: string, name: string) => any; |
| const Category: React.FC<CategoryProps> = props => { |
| const { icons, title, newIcons, theme } = props; |
| const [justCopied, setJustCopied] = React.useState<string | null>(null); |
| const copyId = React.useRef<NodeJS.Timeout | null>(null); |
| const onSelect = React.useCallback((type: string, text: string) => { |
| const { onSelect } = props; |
| copyId.current = setTimeout(() => { |
| clearTimeout(Number(copyId.current)); |
| <h4>{intl.formatMessage({ |
| id: `app.docs.components.icon.category.${title}`, |
| <ul className={styles.anticonsList}> |
| isNew={newIcons.includes(name)} |