mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 17:46:51 +08:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: fatelei <fatelei@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: 盐粒 Yanli <yanli@dify.ai> Co-authored-by: Charles Yao <chongbinyao33@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: yunlu.wen <yunlu.wen@dify.ai> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com> Co-authored-by: Jingyi <jingyi.qi@dify.ai> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: Asuka Minato <i@asukaminato.eu.org> 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: chariri <w@chariri.moe> Co-authored-by: Evan <2869018789@qq.com> Co-authored-by: zyssyz123 <916125788@qq.com>
60 lines
1.9 KiB
TypeScript
60 lines
1.9 KiB
TypeScript
'use client'
|
|
|
|
import {
|
|
AlertDialog,
|
|
AlertDialogActions,
|
|
AlertDialogCancelButton,
|
|
AlertDialogConfirmButton,
|
|
AlertDialogContent,
|
|
AlertDialogDescription,
|
|
AlertDialogTitle,
|
|
} from '@langgenius/dify-ui/alert-dialog'
|
|
import { memo, useCallback } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
type OpenScopeConfirmDialogProps = {
|
|
open: boolean
|
|
onCancel: () => void
|
|
onConfirm: () => void
|
|
}
|
|
|
|
function OpenScopeConfirmDialog({
|
|
open,
|
|
onCancel,
|
|
onConfirm,
|
|
}: OpenScopeConfirmDialogProps) {
|
|
const { t } = useTranslation()
|
|
const handleOpenChange = useCallback((nextOpen: boolean) => {
|
|
if (!nextOpen)
|
|
onCancel()
|
|
}, [onCancel])
|
|
|
|
return (
|
|
<AlertDialog
|
|
open={open}
|
|
onOpenChange={handleOpenChange}
|
|
>
|
|
<AlertDialogContent className="w-120 overflow-hidden! rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg p-0! text-left align-middle shadow-lg">
|
|
<div className="flex flex-col items-start gap-2 self-stretch p-6 pb-4">
|
|
<AlertDialogTitle className="title-2xl-semi-bold text-text-primary">
|
|
{t('accessRule.changeOpenScopeTitle', { ns: 'permission' })}
|
|
</AlertDialogTitle>
|
|
<AlertDialogDescription render={<div />} className="system-md-regular text-text-secondary">
|
|
{t('accessRule.changeOpenScopeDescription', { ns: 'permission' })}
|
|
</AlertDialogDescription>
|
|
</div>
|
|
<AlertDialogActions className="gap-2 p-6">
|
|
<AlertDialogCancelButton variant="secondary">
|
|
{t('operation.cancel', { ns: 'common' })}
|
|
</AlertDialogCancelButton>
|
|
<AlertDialogConfirmButton onClick={onConfirm}>
|
|
{t('operation.change', { ns: 'common' })}
|
|
</AlertDialogConfirmButton>
|
|
</AlertDialogActions>
|
|
</AlertDialogContent>
|
|
</AlertDialog>
|
|
)
|
|
}
|
|
|
|
export default memo(OpenScopeConfirmDialog)
|