1- import { PluginResponseVal } from "../store/Plugin.ts" ;
1+ import { CompatibilityStatus , PluginResponseVal } from "../store/Plugin.ts" ;
22import { FC , useMemo } from "react" ;
33import TimeAgo from 'javascript-time-ago'
44import en from 'javascript-time-ago/locale/en'
@@ -7,6 +7,7 @@ import * as marked from 'marked'
77import { PluginAuthorComp } from "./PluginAuthorComp.tsx" ;
88import { Chip } from "./Chip.tsx" ;
99import { useUIStore } from "@/store/store.ts" ;
10+ import { Check , OctagonAlert , TriangleAlert } from "lucide-react" ;
1011type PluginProps = {
1112 plugins : PluginResponseVal ,
1213 index : number
@@ -46,13 +47,25 @@ export const PluginCom: FC<PluginProps> = ({plugins}) => {
4647 return downloadStatsStyle
4748 } , [ ] )
4849
50+ const renderCompatibilityIndicator = ( compatibility : string ) => {
51+ if ( compatibility === CompatibilityStatus . Failed ) {
52+ return < span title = { 'Plugin probably not compatible with latest Etherpad version' } style = { { color : 'red' } } > < OctagonAlert /> </ span >
53+ }
54+
55+ if ( compatibility === CompatibilityStatus . Compatible ) {
56+ return < span title = { 'Plugin is compatible with latest Etherpad version' } style = { { color : 'green' } } > < Check /> </ span >
57+ }
58+
59+ return < span title = { 'Plugin might have issues running on latest Etherpad version' } style = { { color : 'yellow' } } > < TriangleAlert /> </ span >
60+ }
4961
5062
5163 return < div className = "text-gray-400 border-[1px] p-2 rounded-2xl bg-gray-900 " >
5264 < div className = "flex" >
5365 < div className = "text-3xl text-primary flex gap-3" >
5466 < a target = { "_blank" } href = { 'https://www.npmjs.org/package/' + plugins . name } > { plugins . name } </ a >
5567 < small className = "align-text-bottom text-gray-400 mt-[3px]" > { plugins . version } </ small >
68+ { plugins . compatibility && < span className = "text-gray-400 mt-[7px]" > { renderCompatibilityIndicator ( plugins . compatibility ) } </ span > }
5669 </ div >
5770 < div className = "grow" > </ div >
5871 { plugins . modified && < div className = "mr-5 mt-[0.3rem]" title = { `Last updated ${ plugins . modified } ` } > { formatTime ( plugins . modified ) } </ div > }
0 commit comments