mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-21 21:29:20 +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
16 lines
617 B
TypeScript
16 lines
617 B
TypeScript
import { createLucideIcon } from 'lucide-react/src/lucide-react';
|
|
import { type LucideProps, type IconNode } from 'lucide-react/src/createLucideIcon';
|
|
import { IconEntity } from '../theme/types';
|
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
import { IconContent } from './generateZip';
|
|
|
|
const getFallbackZip = (icons: IconEntity[], params: LucideProps) => {
|
|
return icons.map<IconContent>((icon) => {
|
|
const Icon = createLucideIcon(icon.name, icon.iconNode as IconNode);
|
|
const src = renderToStaticMarkup(<Icon {...params} />);
|
|
return [icon.name, src];
|
|
});
|
|
};
|
|
|
|
export default getFallbackZip;
|