mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-17 00:47:43 +01:00
* Implement deprecate comment lucide-react * Add export template with comment * Add block comment to Lucide Svelte * Add blockcomment to lucide-angular * Add block comment to lucide-static * revert runtime change build:tags * Fix failed tests * Remove optional property in icon schema
33 lines
786 B
JavaScript
33 lines
786 B
JavaScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
|
|
|
export default ({ componentName, iconName, children, getSvg, deprecated }) => {
|
|
let svgContents = getSvg();
|
|
const svgBase64 = base64SVG(svgContents);
|
|
|
|
svgContents = svgContents.replace(
|
|
'<svg',
|
|
`
|
|
<svg
|
|
class="lucide lucide-${iconName}"`,
|
|
);
|
|
|
|
return `
|
|
/**
|
|
* @name ${iconName}
|
|
* @description Lucide SVG string.
|
|
*
|
|
* @preview  - https://lucide.dev/icons/${iconName}
|
|
* @see https://lucide.dev/guide/packages/lucide-static - Documentation
|
|
*
|
|
* @returns {String}
|
|
* ${deprecated ? '@deprecated' : ''}
|
|
*/
|
|
const ${componentName}: string = \`\
|
|
${svgContents}\
|
|
\`
|
|
|
|
export default ${componentName};
|
|
`;
|
|
};
|