- Notion
-
/
- notion-page-search
+
+ )
+}
+
+export const Icon = ({
+ className,
+ src,
+ installed = false,
+}: {
+ className?: string
+ src: string
+ installed?: boolean
+}) => {
+ return (
+
+
+ )
+}
+
+export const Title = ({
+ title,
+}: {
+ title: string
+}) => {
+ return (
+
+ {title}
+
+ )
+}
+
+export const OrgInfo = ({
+ className,
+ orgName,
+ packageName,
+}: {
+ className?: string
+ orgName: string
+ packageName: string
+}) => {
+ return
+ {orgName}
+ /
+ {packageName}
+
+}
+
+type DescriptionProps = {
+ className?: string
+ text: string
+ descriptionLineRows: number
+}
+
+const Description: FC
= ({
+ className,
+ text,
+ descriptionLineRows,
+}) => {
+ const lineClassName = useMemo(() => {
+ if (descriptionLineRows === 1)
+ return 'truncate'
+ else if (descriptionLineRows === 2)
+ return 'line-clamp-2'
+ else
+ return 'line-clamp-3'
+ }, [descriptionLineRows])
+ return (
+
+ {text}
+
+ )
+}
+
+type Props = {
+ className?: string
+ payload: Plugin
+ installed?: boolean
+ descriptionLineRows?: number
+ footer?: React.ReactNode
+}
+
+const Card = ({
+ className,
+ payload,
+ installed,
+ descriptionLineRows = 2,
+ footer,
+}: Props) => {
+ const locale = getLocaleOnServer()
+
+ const { type, name, org, label } = payload
+ return (
+
+
+ {/* Header */}
+
-
- Search Notion pages and open visited ones faster. No admin access required.
-
+
+ {footer &&
{footer}
}
)
}
diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts
index 47eb6331c0..f9b1add725 100644
--- a/web/app/components/plugins/types.ts
+++ b/web/app/components/plugins/types.ts
@@ -1,9 +1,10 @@
import type { CredentialFormSchemaBase } from '../header/account-setting/model-provider-page/declarations'
+import type { Locale } from '@/i18n'
export enum PluginType {
- plugin = 'plugin',
+ tool = 'tool',
model = 'model',
- extension = 'Extension',
+ extension = 'extension',
}
export type Plugin = {
@@ -12,14 +13,8 @@ export type Plugin = {
'name': string
'latest_version': string
'icon': string
- 'label': {
- 'en_US': string
- 'zh_Hans': string
- }
- 'brief': {
- 'en_US': string
- 'zh_Hans': string
- }
+ 'label': Record
+ 'brief': Record
// Repo readme.md content
'introduction': string
'repository': string