@@ -4,6 +4,7 @@ import { getCommunityPlugin } from '@/src/actions/plugins/get-community-plugins'
44import { CommunityPlugin } from '@/src/types/plugins/plugins.types' ;
55import Image from 'next/image' ;
66import { Fragment , useEffect , useState , memo } from 'react' ;
7+ import { NavArrowRight } from 'iconoir-react' ;
78import ErrorIdentifyPlugin from './error-identify-plugin' ;
89import IdentifyPluginLoader from './identify-plugin-loader' ;
910import { getPluginFromCache , setPluginInCache , hasPluginInCache } from './plugin-cache' ;
@@ -46,25 +47,46 @@ function IdentifyPlugin({ pluginId }: IdentifyPluginProps) {
4647 return < ErrorIdentifyPlugin /> ;
4748 }
4849
50+ const isPublic = ! pluginCommunity . private ;
51+ const pluginUrl = `https://h.omi.me/apps/${ pluginId } ` ;
52+
53+ const content = (
54+ < >
55+ < Image
56+ className = "h-10 w-10 min-w-[40px] rounded-lg object-cover"
57+ src = { pluginCommunity ?. image }
58+ alt = { pluginCommunity ?. name }
59+ width = { 50 }
60+ height = { 50 }
61+ />
62+ < div className = "flex-1" >
63+ < h3 className = "text-lg font-semibold text-white" >
64+ { pluginCommunity ?. name }
65+ </ h3 >
66+ < p className = "line-clamp-1 text-sm text-zinc-400" >
67+ { pluginCommunity . description }
68+ </ p >
69+ </ div >
70+ { isPublic && < NavArrowRight className = "h-5 w-5 text-zinc-500" /> }
71+ </ >
72+ ) ;
73+
4974 return (
5075 < Fragment >
51- < div className = "sticky top-[4rem] z-[50] mb-3 flex items-center gap-2 border-b border-solid border-zinc-900 bg-bg-color bg-opacity-90 px-4 py-3 shadow-sm backdrop-blur-sm md:px-12" >
52- < Image
53- className = "grid h-9 w-9 min-w-[36px] place-items-center rounded-full bg-zinc-700"
54- src = { pluginCommunity ?. image }
55- alt = { pluginCommunity ?. name }
56- width = { 50 }
57- height = { 50 }
58- />
59- < div >
60- < h3 className = "text-base font-semibold md:text-base" >
61- { pluginCommunity ?. name }
62- </ h3 >
63- < p className = "line-clamp-1 text-sm text-gray-500 md:text-base" >
64- { pluginCommunity . description }
65- </ p >
76+ { isPublic ? (
77+ < a
78+ href = { pluginUrl }
79+ target = "_blank"
80+ rel = "noopener noreferrer"
81+ className = "mb-4 flex items-center gap-3 transition-opacity hover:opacity-80"
82+ >
83+ { content }
84+ </ a >
85+ ) : (
86+ < div className = "mb-4 flex items-center gap-3" >
87+ { content }
6688 </ div >
67- </ div >
89+ ) }
6890 </ Fragment >
6991 ) ;
7092}
0 commit comments