'use client' import React from 'react' import type { FC } from 'react' import { useTranslation } from 'react-i18next' import { RiBugLine, RiHardDrive3Line, RiVerifiedBadgeLine, } from '@remixicon/react' import { BoxSparkleFill } from '@/app/components/base/icons/src/vender/plugin' import { Github } from '@/app/components/base/icons/src/public/common' import Tooltip from '@/app/components/base/tooltip' import Badge from '@/app/components/base/badge' import { API_PREFIX } from '@/config' import { useAppContext } from '@/context/app-context' import { useLanguage } from '@/app/components/header/account-setting/model-provider-page/hooks' import type { PluginDetail } from '@/app/components/plugins/types' import { PluginSource } from '@/app/components/plugins/types' import OrgInfo from '@/app/components/plugins/card/base/org-info' import Icon from '@/app/components/plugins/card/base/card-icon' import type { TypeWithI18N } from '../../base/form/types' type PluginInfoProps = { detail: PluginDetail & { icon?: string, label?: TypeWithI18N, author?: string, name?: string, verified?: boolean } size?: 'default' | 'large' } const PluginInfo: FC = ({ detail, size = 'default', }) => { const { t } = useTranslation() const { currentWorkspace } = useAppContext() const locale = useLanguage() const tenant_id = currentWorkspace?.id const { version, source, } = detail const icon = detail.declaration?.icon || detail?.icon const label = detail.declaration?.label || detail?.label const author = detail.declaration?.author || detail?.author const name = detail.declaration?.name || detail?.name const verified = detail.declaration?.verified || detail?.verified const isLarge = size === 'large' const iconSize = isLarge ? 'h-10 w-10' : 'h-8 w-8' const titleSize = isLarge ? 'text-sm' : 'text-xs' return (
{/* Plugin Icon */}
{/* Plugin Details */}
{/* Name and Version */}

{label?.[locale]}

{verified && }
{/* Organization and Source */}
ยท
{/* Source Icon */} {source === PluginSource.marketplace && (
)} {source === PluginSource.github && (
)} {source === PluginSource.local && (
)} {source === PluginSource.debugging && (
)}
) } export default PluginInfo