chore: handle verified

This commit is contained in:
Joel 2024-10-23 11:45:36 +08:00
parent 15acfffd60
commit 8d8d5b5235
3 changed files with 7 additions and 5 deletions

View File

@ -36,7 +36,7 @@ const Card = ({
}: Props) => {
const locale = useGetLanguage()
const { type, name, org, label, brief, icon } = payload
const { type, name, org, label, brief, icon, verified } = payload
const getLocalizedText = (obj: Record<string, string> | undefined) =>
obj?.[locale] || obj?.['en-US'] || ''
@ -60,7 +60,7 @@ const Card = ({
<div className="ml-3 grow">
<div className="flex items-center h-5">
<Title title={getLocalizedText(label)} />
<RiVerifiedBadgeLine className="shrink-0 ml-0.5 w-4 h-4 text-text-accent" />
{verified && <RiVerifiedBadgeLine className="shrink-0 ml-0.5 w-4 h-4 text-text-accent" />}
{titleLeft} {/* This can be version badge */}
</div>
<OrgInfo

View File

@ -1,4 +1,4 @@
import type { Plugin, PluginDeclaration } from "../types"
import type { Plugin, PluginDeclaration } from '../types'
export const pluginManifestToCardPluginProps = (pluginManifest: PluginDeclaration): Plugin => {
return {
@ -11,11 +11,12 @@ export const pluginManifestToCardPluginProps = (pluginManifest: PluginDeclaratio
label: pluginManifest.label,
brief: pluginManifest.description,
icon: pluginManifest.icon,
verified: pluginManifest.verified,
introduction: '',
repository: '',
install_count: 0,
endpoint: {
settings: []
}
settings: [],
},
}
}

View File

@ -94,6 +94,7 @@ export type Plugin = {
version: string
latest_version: string
icon: string
verified: boolean
label: Record<Locale, string>
brief: Record<Locale, string>
// Repo readme.md content