mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 20:17:42 +01:00
* Revert sync to async functions * Replace more sync fs functions * Format files * Fix build svelte package
34 lines
1004 B
JavaScript
34 lines
1004 B
JavaScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
|
|
|
export default async ({
|
|
componentName,
|
|
iconName,
|
|
children,
|
|
getSvg,
|
|
deprecated,
|
|
deprecationReason,
|
|
}) => {
|
|
const svgContents = await getSvg();
|
|
const svgBase64 = base64SVG(svgContents);
|
|
|
|
return `
|
|
import createLucideIcon from '../createLucideIcon';
|
|
|
|
/**
|
|
* @component @name ${componentName}
|
|
* @description Lucide SVG icon component, renders SVG Element with children.
|
|
*
|
|
* @preview  - https://lucide.dev/icons/${iconName}
|
|
* @see https://lucide.dev/guide/packages/lucide-vue-next - Documentation
|
|
*
|
|
* @param {Object} props - Lucide icons props and any valid SVG attribute
|
|
* @returns {FunctionalComponent} Vue component
|
|
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
|
|
*/
|
|
const ${componentName} = createLucideIcon('${componentName}Icon', ${JSON.stringify(children)});
|
|
|
|
export default ${componentName};
|
|
`;
|
|
};
|