import { Activity, BadgeCheck, Binary, Clipboard, Code2, Files, Globe, Keyboard, Monitor, PanelsTopLeft, Search, ShieldAlert, ShieldCheck, Users, } from 'lucide-react' import React from 'react' import '../i18n/domains/plugins.gen' import { I18nKey, locText, t } from '../i18n' import { Locale, PluginInfo, ScanReport } from '../types' import { Tip } from '../ui/controls' export { PluginAppIcon, resolvePluginVisual, type PluginVisual, type PluginVisualSource } from './PluginAppIcon' /** Selects the accurate high-risk warning notice for a plugin (L3 native vs ui:script). */ export function resolvePluginApprovalNotice( plugin: Pick, report: Pick | null | undefined, locale: Locale, ): string { if (plugin.tier === 'L3') { return report?.native_exec_notice ? locText(report.native_exec_notice, locale, t(locale, 'pluginApproveL3Warn')) : t(locale, 'pluginApproveL3Warn') } if ((plugin.permissions ?? []).some((p) => p.name === 'ui:script')) { return t(locale, 'pluginApproveUIScriptWarn') } return '' } /** Publisher + trust-tier mark shared by Installed rows and Market cards. */ export const PluginTrustBadge: React.FC<{ locale: Locale trust: string publisher?: string }> = ({ locale, trust, publisher }) => { const tr = (k: I18nKey) => t(locale, k) const meta = trust === 'official' ? { cls: 'is-official', icon: