mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 06:37:42 +01:00
* Ignore linting for examples in docs * Formatting JSX single attribute per line * Separte `format` and `lint:format` in package.json * Bump prettier version * Run format
18 lines
451 B
TypeScript
18 lines
451 B
TypeScript
import iconNodes from '../../../data/iconNodes';
|
|
|
|
const getRandomItem = <Item>(items: Item[]): Item =>
|
|
items[Math.floor(Math.random() * items.length)];
|
|
|
|
export default {
|
|
async load() {
|
|
const icons = Object.entries(iconNodes).map(([name, iconNode]) => ({ name, iconNode }));
|
|
|
|
const randomIcons = Array.from({ length: 200 }, () => getRandomItem(icons));
|
|
|
|
return {
|
|
icons: randomIcons,
|
|
iconsCount: icons.length,
|
|
};
|
|
},
|
|
};
|