Files

29 lines
918 B
TypeScript
Raw Permalink Normal View History

2026-07-31 09:11:20 +02:00
import base64SVG from '@lucide/build-icons/utils/base64SVG';
import defineExportTemplate from '@lucide/build-icons/utils/defineExportTemplate';
import { toCamelCase } from '@lucide/helpers';
2026-07-31 09:11:20 +02:00
export default defineExportTemplate(
async ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = await getSvg();
const svgBase64 = base64SVG(svgContents);
2026-07-31 09:11:20 +02:00
return `
import type { IconNode } from '../types';
/**
* @name ${iconName}
* @description Lucide Lab SVG icon node.
*
* @preview ![img](data:image/svg+xml;base64,${svgBase64}) - https://lucide.dev/icons/${iconName}
* @see https://lucide.dev/guide/packages/lucide - Documentation
*
* @returns {Array}
2026-07-31 09:11:20 +02:00
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${toCamelCase(componentName)}: IconNode = ${JSON.stringify(children)};
export default ${toCamelCase(componentName)};
`;
2026-07-31 09:11:20 +02:00
},
);