mirror of
https://github.com/langgenius/dify.git
synced 2026-03-07 08:35:58 +08:00
refactor: chagne card to client component
This commit is contained in:
@ -69,7 +69,6 @@ const InstallFromLocalPackage: React.FC<InstallFromLocalPackageProps> = ({ onClo
|
||||
<div className='flex p-2 items-start content-start gap-1 self-stretch flex-wrap rounded-2xl bg-background-section-burn'>
|
||||
<Card
|
||||
className='w-full'
|
||||
locale={locale}
|
||||
payload={status === 'uploading' ? { name: 'notion-sync' } as any : toolNotion as any}
|
||||
isLoading={status === 'uploading'}
|
||||
loadingFileName='notion-sync.difypkg'
|
||||
@ -85,7 +84,7 @@ const InstallFromLocalPackage: React.FC<InstallFromLocalPackageProps> = ({ onClo
|
||||
: (
|
||||
<>
|
||||
<Button variant='secondary' className='min-w-[72px]' onClick={onClose}>
|
||||
Cancel
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
variant='primary'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import React, { useMemo, useState } from 'react'
|
||||
import { useContext } from 'use-context-selector'
|
||||
import { RiInformation2Line } from '@remixicon/react'
|
||||
import Card from '../../card'
|
||||
import { extensionDallE, modelGPT4, toolNotion } from '../../card/card-mock'
|
||||
@ -9,14 +8,12 @@ import Modal from '@/app/components/base/modal'
|
||||
import Button from '@/app/components/base/button'
|
||||
import Checkbox from '@/app/components/base/checkbox'
|
||||
import Badge, { BadgeState } from '@/app/components/base/badge/index'
|
||||
import I18n from '@/context/i18n'
|
||||
|
||||
type InstallFromMarketplaceProps = {
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
const InstallFromMarketplace: React.FC<InstallFromMarketplaceProps> = ({ onClose }) => {
|
||||
const { locale } = useContext(I18n)
|
||||
const plugins = useMemo(() => [toolNotion, extensionDallE, modelGPT4], [])
|
||||
const [selectedPlugins, setSelectedPlugins] = useState<Set<number>>(new Set())
|
||||
const [isInstalling, setIsInstalling] = useState(false)
|
||||
@ -40,7 +37,6 @@ const InstallFromMarketplace: React.FC<InstallFromMarketplaceProps> = ({ onClose
|
||||
key={index}
|
||||
installed={nextStep && !isInstalling}
|
||||
payload={plugin}
|
||||
locale={locale}
|
||||
className='w-full'
|
||||
titleLeft={
|
||||
plugin.version === plugin.latest_version
|
||||
@ -115,7 +111,7 @@ const InstallFromMarketplace: React.FC<InstallFromMarketplaceProps> = ({ onClose
|
||||
: (
|
||||
<>
|
||||
<Button variant='secondary' className='min-w-[72px]' onClick={onClose}>
|
||||
Cancel
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
variant='primary'
|
||||
@ -126,7 +122,7 @@ const InstallFromMarketplace: React.FC<InstallFromMarketplaceProps> = ({ onClose
|
||||
mockInstall()
|
||||
}}
|
||||
>
|
||||
Install
|
||||
Install
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user