@@ -14,6 +14,7 @@ import { useContext, useEffect, useState } from "react";
1414import ContextMenu from "../interface/context-menu" ;
1515import { EditorContext } from "../providers/editor-context-provider" ;
1616import { getPlatform } from "@/lib/platform-api/platform-checker" ;
17+ import { getRemoteClientBaseURL } from "@/lib/module-federation/remote" ;
1718
1819export default function ExtensionPreview ( {
1920 extension,
@@ -52,6 +53,8 @@ export default function ExtensionPreview({
5253 ) ;
5354 setIsInstalled ( foundExt !== undefined ) ;
5455 setIsEnabled ( foundExt ?. isEnabled ?? false ) ;
56+
57+ console . log ( "Extension preview loaded" , extension ) ;
5558 } , [ extension ] ) ;
5659
5760 function toggleExtension ( ) {
@@ -116,7 +119,25 @@ export default function ExtensionPreview({
116119 isOpen : true ,
117120 } ) ) ;
118121 } }
119- > </ Button >
122+ >
123+ { extension . config . thumbnail ? (
124+ < img
125+ src = {
126+ getRemoteClientBaseURL (
127+ extension . remoteOrigin ,
128+ extension . config . id ,
129+ extension . config . version ,
130+ ) +
131+ "/" +
132+ extension . config . thumbnail
133+ }
134+ alt = { extension . config . displayName }
135+ className = "h-full w-full rounded-md object-cover"
136+ />
137+ ) : (
138+ < Skeleton className = "h-full w-full" isLoaded = { false } > </ Skeleton >
139+ ) }
140+ </ Button >
120141 { isShowInfo && (
121142 < div className = "absolute bottom-0.5 left-1/2 flex w-full -translate-x-1/2 justify-center gap-x-0.5" >
122143 < Button color = "secondary" size = "sm" >
0 commit comments