import * as React from 'react'; import { message } from 'antd'; import { injectIntl } from 'react-intl'; import CopyableIcon from './CopyableIcon'; import type { ThemeType } from './index'; import type { CategoriesKeys } from './fields'; interface CategoryProps { title: CategoriesKeys; icons: string[]; theme: ThemeType; newIcons: string[]; intl: any; } const Category: React.FC = props => { const { icons, title, newIcons, theme, intl } = props; const [justCopied, setJustCopied] = React.useState(null); const copyId = React.useRef(null); const onCopied = React.useCallback((type: string, text: string) => { message.success( {text} copied 🎉 , ); setJustCopied(type); copyId.current = setTimeout(() => { setJustCopied(null); }, 2000); }, []); React.useEffect( () => () => { if (copyId.current) { clearTimeout(copyId.current); } }, [], ); return (

{intl.messages[`app.docs.components.icon.category.${title}`]}

    {icons.map(name => ( ))}
); }; export default injectIntl(Category);