Files
lucide/docs/.vitepress/theme/components/home/HomeHeroIconsCard.data.ts
Han Yeong-woo eb035fe370 Improve formatting (#1814)
* 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
2024-02-01 14:38:21 +01:00

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,
};
},
};