mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-17 11:09:06 +08:00
Fix: Refactoring and enhancing the functionality of the delete confirmation dialog component #10703 (#11542)
### What problem does this PR solve? Fix: Refactoring and enhancing the functionality of the delete confirmation dialog component - Refactoring and enhancing the functionality of the delete confirmation dialog component - Modifying the style of the user center ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
import {
|
||||
ConfirmDeleteDialog,
|
||||
ConfirmDeleteDialogNode,
|
||||
} from '@/components/confirm-delete-dialog';
|
||||
import { RAGFlowAvatar } from '@/components/ragflow-avatar';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
@ -26,7 +30,7 @@ const ColorMap: Record<string, string> = {
|
||||
|
||||
const UserTable = ({ searchUser }: { searchUser: string }) => {
|
||||
const { data, loading } = useListTenantUser();
|
||||
const { handleDeleteTenantUser } = useHandleDeleteUser();
|
||||
const { deleteTenantUser } = useHandleDeleteUser();
|
||||
const [sortOrder, setSortOrder] = useState<'asc' | 'desc' | null>(null);
|
||||
const { t } = useTranslation();
|
||||
const sortedData = useMemo(() => {
|
||||
@ -134,14 +138,35 @@ const UserTable = ({ searchUser }: { searchUser: string }) => {
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="p-4">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 p-0 hover:bg-state-error-5 hover:text-state-error"
|
||||
onClick={handleDeleteTenantUser(record.user_id)}
|
||||
<ConfirmDeleteDialog
|
||||
title={t('deleteModal.delMember')}
|
||||
onOk={async () => {
|
||||
await deleteTenantUser({
|
||||
userId: record.user_id,
|
||||
});
|
||||
return;
|
||||
}}
|
||||
content={{
|
||||
node: (
|
||||
<ConfirmDeleteDialogNode
|
||||
avatar={{
|
||||
avatar: record.avatar,
|
||||
name: record.nickname,
|
||||
isPerson: true,
|
||||
}}
|
||||
name={record.email}
|
||||
></ConfirmDeleteDialogNode>
|
||||
),
|
||||
}}
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 p-0 hover:bg-state-error-5 hover:text-state-error"
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
</Button>
|
||||
</ConfirmDeleteDialog>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user