Files
supabase/packages/icons/scripts/exportTemplate.mjs
T
Jonathan Summers-MuirandIvan Vasilov d8ae6de7a8 feat: add new Icons package for custom made icons (#21477)
* feat: add new Icons package

* Create README.md

* add more icons

* add "Home" icon and "Postgres" icon

* reduce helpers

* remove old files

* make dev deps

* Delete package-lock.json

* Update README.md

* add to packages for other apps

* remove from db.design

* Update README.md

* Move the build-icons package in the packages folder.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-02-26 09:40:56 +01:00

26 lines
803 B
JavaScript

/* eslint-disable import/no-extraneous-dependencies */
import { base64SVG } from '@supabase/build-icons'
export default ({ componentName, iconName, children, getSvg, deprecated }) => {
const svgContents = getSvg()
const svgBase64 = base64SVG(svgContents)
return `
import createSupabaseIcon from '../createSupabaseIcon';
/**
* @component @name ${componentName}
* @description Supabase SVG icon component, renders SVG Element with children.
*
* @preview ![img](data:image/svg+xml;base64,${svgBase64})
*
* @param {Object} props - Supabase icons props and any valid SVG attribute
* @returns {JSX.Element} JSX Element
* ${deprecated ? '@deprecated' : ''}
*/
const ${componentName} = createSupabaseIcon('${componentName}', ${JSON.stringify(children)});
export default ${componentName};
`
}