Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
'use client'
import type { Role } from '@/models/access-control'
import {
AlertDialog,
AlertDialogConfirmButton,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from '@langgenius/dify-ui/alert-dialog'
import { useQuery } from '@tanstack/react-query'
import { useTranslation } from 'react-i18next'
import { consoleQuery } from '@/service/console'
type CopyMembersConfirmDialogProps = {
role: Role
isCopyingRole: boolean
onOpenChange: (open: boolean) => void
onDuplicate: (copyMember: boolean) => void
}
export function CopyMembersConfirmDialog({
role,
isCopyingRole,
onOpenChange,
onDuplicate,
}: CopyMembersConfirmDialogProps) {
const { t } = useTranslation(['common', 'permission'])
const { data: membersOfRole, isPending: isLoadingMembersOfRole } = useQuery(
consoleQuery.workspaces.current.rbac.roles.byRoleId.members.get.queryOptions({
input: { params: { role_id: role.id }, query: { page: 1, limit: 9999 } },
}),
)
const memberCount = membersOfRole?.pagination?.total_count ?? 0
const isLoadingMemberCount = isLoadingMembersOfRole && !membersOfRole
const isActionDisabled = isCopyingRole || isLoadingMemberCount
return (
<AlertDialog open onOpenChange={onOpenChange}>
<AlertDialogContent backdropProps={{ forceRender: true }}>
<AlertDialogHeader>
<AlertDialogTitle>
{t(($) => $['role.copyMembersTitle'], { ns: 'permission' })}
</AlertDialogTitle>
<AlertDialogDescription>
{isLoadingMemberCount
? t(($) => $['role.copyMembersLoading'], { ns: 'permission' })
: t(($) => $['role.copyMembersDescription'], {
ns: 'permission',
name: role.name,
count: memberCount,
})}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogConfirmButton
variant="secondary"
tone="default"
disabled={isActionDisabled}
onClick={() => onDuplicate(false)}
>
{t(($) => $['operation.skip'], { ns: 'common' })}
</AlertDialogConfirmButton>
<AlertDialogConfirmButton
tone="default"
disabled={isLoadingMemberCount}
loading={isCopyingRole}
onClick={() => onDuplicate(true)}
>
{t(($) => $['operation.copy'], { ns: 'common' })}
</AlertDialogConfirmButton>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
)
}