File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
nx-dev/ui-markdoc/src/lib/tags Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export function LinkCard({
117117} : {
118118 title : string ;
119119 type : string ;
120- icon : string ; // `icon` is the link to the SVG file
120+ icon : string ; // Can be either a component name or a direct image URL
121121 url : string ;
122122 appearance ?: 'default' | 'small' ;
123123} ) : JSX . Element {
@@ -138,13 +138,20 @@ export function LinkCard({
138138 }
139139 ) }
140140 >
141- { icon &&
142- ( frameworkIcons [ icon as Framework ] ?. image ||
143- callIfFunction ( nxDevIcons [ icon as keyof typeof nxDevIcons ] ) ||
144- callIfFunction (
145- ( heroIcons [ icon as keyof typeof heroIcons ] as any ) ?. render ,
146- { className : 'w-full h-full' }
147- ) ) }
141+ { icon . startsWith ( '/' ) ? (
142+ < img
143+ src = { icon }
144+ alt = { title }
145+ className = "h-full w-full object-contain"
146+ />
147+ ) : (
148+ frameworkIcons [ icon as Framework ] ?. image ||
149+ callIfFunction ( nxDevIcons [ icon as keyof typeof nxDevIcons ] ) ||
150+ callIfFunction (
151+ ( heroIcons [ icon as keyof typeof heroIcons ] as any ) ?. render ,
152+ { className : 'w-full h-full' }
153+ )
154+ ) }
148155 </ div >
149156 ) }
150157 < div
You can’t perform that action at this time.
0 commit comments