mirror of
https://github.com/langgenius/dify.git
synced 2026-06-17 06:21:07 +08:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: fatelei <fatelei@gmail.com> Co-authored-by: Asuka Minato <i@asukaminato.eu.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com> Co-authored-by: gigglewang <gigglewang@dify.ai> Co-authored-by: Yunlu Wen <yunlu.wen@dify.ai> Co-authored-by: chariri <w@chariri.moe> Co-authored-by: Evan <2869018789@qq.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
53 lines
1.9 KiB
TypeScript
53 lines
1.9 KiB
TypeScript
'use client'
|
|
|
|
import type { IntegrationSection } from '@/app/components/integrations/routes'
|
|
import { Button } from '@langgenius/dify-ui/button'
|
|
import { useCallback } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import MenuDialog from '@/app/components/header/account-setting/menu-dialog'
|
|
import IntegrationsPage from '@/app/components/integrations/page'
|
|
import { getMarketplaceUrl } from '@/utils/var'
|
|
|
|
type IntegrationsSettingModalProps = {
|
|
section: IntegrationSection
|
|
onCancel: () => void
|
|
onSectionChange: (section: IntegrationSection) => void
|
|
}
|
|
|
|
export default function IntegrationsSettingModal({
|
|
section,
|
|
onCancel,
|
|
onSectionChange,
|
|
}: IntegrationsSettingModalProps) {
|
|
const { t } = useTranslation()
|
|
const handleSwitchToMarketplace = useCallback((path: string) => {
|
|
window.open(getMarketplaceUrl(path), '_blank', 'noopener,noreferrer')
|
|
}, [])
|
|
|
|
return (
|
|
<MenuDialog show onClose={onCancel}>
|
|
<div className="mx-auto flex h-dvh w-[min(1440px,calc(100vw-48px))] shrink-0 py-6">
|
|
<div className="relative flex min-h-0 w-full shrink-0 overflow-hidden rounded-2xl border border-divider-subtle bg-components-panel-bg shadow-2xl">
|
|
<div className="fixed top-6 right-6 z-9999 flex flex-col items-center">
|
|
<Button
|
|
variant="tertiary"
|
|
size="large"
|
|
className="px-2"
|
|
aria-label={t('operation.close', { ns: 'common' })}
|
|
onClick={onCancel}
|
|
>
|
|
<span className="i-ri-close-line h-5 w-5" />
|
|
</Button>
|
|
<div className="mt-1 system-2xs-medium-uppercase text-text-tertiary">ESC</div>
|
|
</div>
|
|
<IntegrationsPage
|
|
section={section}
|
|
onSectionChange={onSectionChange}
|
|
onSwitchToMarketplace={handleSwitchToMarketplace}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</MenuDialog>
|
|
)
|
|
}
|