mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 23:57:43 +01:00
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};
|
||
|
|
`;
|
||
|
|
};
|