diff --git a/client/components/IconUsageExamples/ExampleHomeAssistant.tsx b/client/components/IconUsageExamples/ExampleHomeAssistant.tsx index 9a6d790..75c4d51 100644 --- a/client/components/IconUsageExamples/ExampleHomeAssistant.tsx +++ b/client/components/IconUsageExamples/ExampleHomeAssistant.tsx @@ -8,9 +8,11 @@ import Link from '@/components/Link/Link'; import Code from '@/components/CodeHighlighter/CodeHighlighter'; import classes from './IconUsageExamples.module.scss'; +import { IconLibrary } from '@/interfaces/icons'; interface ExampleHomeAssistantProps { library: string; + libraryInfo: IconLibrary; iconName: string; visible: boolean; } diff --git a/client/components/IconUsageExamples/ExampleReact.tsx b/client/components/IconUsageExamples/ExampleReact.tsx index f27a24f..1db03e9 100644 --- a/client/components/IconUsageExamples/ExampleReact.tsx +++ b/client/components/IconUsageExamples/ExampleReact.tsx @@ -11,13 +11,16 @@ import kebabToPascal from '@/utils/helpers/kebabToPascal'; import classes from './IconUsageExamples.module.scss'; +import { IconLibrary } from '@/interfaces/icons'; + interface ExampleReactProps { library: string; + libraryInfo: IconLibrary; iconName: string; visible: boolean; } -const ExampleReact: FunctionComponent = ({ iconName, library, visible }) => { +const ExampleReact: FunctionComponent = ({ iconName, library, libraryInfo, visible }) => { const jsName = `${library}${kebabToPascal(iconName)}`; return ( @@ -30,7 +33,7 @@ const ExampleReact: FunctionComponent = ({ iconName, library, > { `import Icon from '@mdi/react'; -import { ${jsName} } from '@${library}/js'; +import { ${jsName} } from '@${libraryInfo.jsPackage}'; ` } diff --git a/client/components/IconUsageExamples/ExampleVue.tsx b/client/components/IconUsageExamples/ExampleVue.tsx index 089909a..d65d86d 100644 --- a/client/components/IconUsageExamples/ExampleVue.tsx +++ b/client/components/IconUsageExamples/ExampleVue.tsx @@ -10,14 +10,16 @@ import Code from '@/components/CodeHighlighter/CodeHighlighter'; import kebabToPascal from '@/utils/helpers/kebabToPascal'; import classes from './IconUsageExamples.module.scss'; +import { IconLibrary } from '@/interfaces/icons'; interface ExampleVueProps { library: string; + libraryInfo: IconLibrary; iconName: string; visible: boolean; } -const ExampleVue: FunctionComponent = ({ iconName, library, visible }) => { +const ExampleVue: FunctionComponent = ({ iconName, library, libraryInfo, visible }) => { const jsName = `${library}${kebabToPascal(iconName)}`; return ( @@ -35,7 +37,7 @@ const ExampleVue: FunctionComponent = ({ iconName, library, vis