File tree 1 file changed +15
-8
lines changed
nx-dev/ui-markdoc/src/lib/tags
1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export function LinkCard({
117
117
} : {
118
118
title : string ;
119
119
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
121
121
url : string ;
122
122
appearance ?: 'default' | 'small' ;
123
123
} ) : JSX . Element {
@@ -138,13 +138,20 @@ export function LinkCard({
138
138
}
139
139
) }
140
140
>
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
+ ) }
148
155
</ div >
149
156
) }
150
157
< div
You can’t perform that action at this time.
0 commit comments