-
-
Save mateusz-wierzbicki/81cfc74c178baba1b7439b1cf6b5084a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import * as TablerIcons from '@tabler/icons-react'; | |
| // Default size and stroke width for all icons | |
| const defaultSize = '1em'; | |
| const defaultStrokeWidth = 2; | |
| const getIcon = (IconComponent) => { | |
| return ( | |
| <IconComponent | |
| className="anticon" | |
| size={defaultSize} | |
| strokeWidth={defaultStrokeWidth} | |
| /> | |
| ); | |
| }; | |
| // Create the icon map | |
| const IconMap = {}; | |
| Object.keys(TablerIcons).forEach((iconName) => { | |
| IconMap[iconName] = getIcon(TablerIcons[iconName]); | |
| }); | |
| export default IconMap; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment