11import { FC , lazy , useEffect , useState , Suspense } from "react" ;
22import { useAppContext } from "../../../contexts/AppContext" ;
3+ import { EXTENSION_ID } from "../../../hooks/useExtension" ;
34
45type FederatedComponent = FC < {
56 key : string ;
@@ -10,12 +11,13 @@ type FederatedComponent = FC<{
1011} > ;
1112
1213export const Plugin : FC = ( ) => {
13- const { plugins, profiles, deck } = useAppContext ( ) ;
14+ const { plugins, profiles, deck, extension } = useAppContext ( ) ;
1415 const [ Plugin , setPlugin ] = useState < FederatedComponent | null > ( null ) ;
1516
1617 const key = deck . selectedKey ! ;
1718 const keyConfig = profiles . profile . keys [ key ] ;
1819 const module = plugins . modules [ keyConfig ?. plugin ] ;
20+ const manifest = plugins . manifests ?. [ keyConfig ?. plugin ] ;
1921 const loaded = module ?. loaded ;
2022
2123 useEffect ( ( ) => {
@@ -44,6 +46,27 @@ export const Plugin: FC = () => {
4446 overflow : "hidden" ,
4547 } }
4648 >
49+ { manifest ?. extension_required === true &&
50+ extension . installed === false ? (
51+ < div
52+ style = { {
53+ marginBottom : 8 ,
54+ padding : 8 ,
55+ border : "1px solid black" ,
56+ background : "orange" ,
57+ borderRadius : 8 ,
58+ } }
59+ >
60+ < span > This plugin required the </ span >
61+ < a
62+ target = "_blank"
63+ rel = "noopener noreferrer"
64+ href = { `https://chrome.google.com/webstore/detail/${ EXTENSION_ID } ` }
65+ >
66+ Webdeck Extension
67+ </ a > { " " }
68+ </ div >
69+ ) : null }
4770 < Suspense fallback = "Loading System" >
4871 { Plugin && keyConfig ?. config && module ? (
4972 < Plugin
0 commit comments