mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-17 00:07:40 +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
27 lines
952 B
JavaScript
27 lines
952 B
JavaScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
|
|
|
export default ({ componentName, iconName, children, getSvg, deprecated }) => {
|
|
const svgContents = getSvg();
|
|
const svgBase64 = base64SVG(svgContents);
|
|
|
|
return `\
|
|
import { LucideIconData } from './types';
|
|
|
|
/**
|
|
* @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' : ''}
|
|
*/
|
|
const ${componentName}: LucideIconData = ${JSON.stringify(children)}; //eslint-disable-line no-shadow-restricted-names
|
|
|
|
export default ${componentName};
|
|
`;
|
|
};
|