import { startCase, camelCase } from "lodash";
import {
BUNDLED_LANGUAGES,
type IThemeRegistration
} from 'shiki'
import {
getHighlighter,
} from 'shiki-processor'
type CodeExampleType = {
title: string,
lang: string,
codes: {
language?: string,
code: string,
metastring?: string,
}[],
}[]
const getIconCodes = (name: string): CodeExampleType => {
const pascalCase = startCase(camelCase(name)).replace(/\s/g, '')
return [
{
lang: 'html',
title: 'HTML',
codes: [
{
language: 'html',
code: `
`,
},
],
},
{
lang: 'tsx',
title: 'React',
codes: [
{
language: 'tsx',
code: `import { ${pascalCase} } from 'lucide-react';
const App = () => {
return (
<${pascalCase}
color="red"
size={48}
strokeWidth={1.5}
/>
);
};
export default App;
`,
metastring: '{1,4}',
},
],
},
{
lang: 'vue',
title: 'Vue 3',
codes: [
{
language: 'vue',
code: `
<${pascalCase} color="red" :size="32" />
`,
metastring: '{2,6}',
},
],
},
{
lang: 'svelte',
title: 'Svelte',
codes: [
{
language: 'vue',
code: `
<${pascalCase}
color={red}
size={48}
strokeWidth={1.5}
/>
`,
metastring: '{2,5}',
},
],
},
{
lang: 'preact',
title: 'Preact',
codes: [
{
language: 'tsx',
code: `import { ${pascalCase} } from 'lucide-preact';
const App = () => {
return (
<${pascalCase}
color="red"
size={48}
strokeWidth={1.5}
/>
);
};
export default App;
`,
metastring: '{1,4}',
},
],
},
{
lang: 'solid',
title: 'Solid',
codes: [
{
language: 'tsx',
code: `import { ${pascalCase} } from 'lucide-solid';
const App = () => {
return (
<${pascalCase}
color="red"
size={48}
strokeWidth={1.5}
/>
);
};
export default App;
`,
metastring: '{1,4}',
},
],
},
{
lang: 'angular',
title: 'Angular',
codes: [
{
language: 'tsx',
code: `// app.module.ts
import { LucideAngularModule, ${pascalCase} } from 'lucide-angular';\r
@NgModule({
imports: [
LucideAngularModule.pick({ ${pascalCase} })
],
})
// app.component.html