mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-24 22:15:18 +00:00
Major additions: - Complete Next.js studio application with 1600+ components - Docker support (Dockerfile.combined, docker-compose.yml) - GCP deployment documentation and benchmarks - SQL benchmark scripts for performance testing - Sentry integration for monitoring - Comprehensive test suite and mocks Studio features: - Dashboard and admin interfaces - Data visualization components - Authentication and user management - API integration with RuVector backend - Static data and public assets 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
import { useParams } from 'common'
|
|
import { toast } from 'sonner'
|
|
|
|
import { useUserDeleteMutation } from 'data/auth/user-delete-mutation'
|
|
import { User } from 'data/auth/users-infinite-query'
|
|
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
|
|
|
|
interface DeleteUserModalProps {
|
|
visible: boolean
|
|
selectedUser?: User
|
|
onClose: () => void
|
|
onDeleteSuccess?: () => void
|
|
}
|
|
|
|
export const DeleteUserModal = ({
|
|
visible,
|
|
selectedUser,
|
|
onClose,
|
|
onDeleteSuccess,
|
|
}: DeleteUserModalProps) => {
|
|
const { ref: projectRef } = useParams()
|
|
|
|
const { mutate: deleteUser, isPending: isDeleting } = useUserDeleteMutation({
|
|
onSuccess: () => {
|
|
toast.success(`Successfully deleted ${selectedUser?.email}`)
|
|
onDeleteSuccess?.()
|
|
},
|
|
})
|
|
|
|
const handleDeleteUser = async () => {
|
|
if (!projectRef) return console.error('Project ref is required')
|
|
if (selectedUser?.id === undefined) {
|
|
return toast.error(`Failed to delete user: User ID not found`)
|
|
}
|
|
deleteUser({ projectRef, userId: selectedUser.id })
|
|
}
|
|
|
|
return (
|
|
<ConfirmationModal
|
|
visible={visible}
|
|
variant="destructive"
|
|
title="Confirm to delete user"
|
|
loading={isDeleting}
|
|
confirmLabel="Delete"
|
|
onCancel={() => onClose()}
|
|
onConfirm={() => handleDeleteUser()}
|
|
alert={{
|
|
title: 'Deleting a user is irreversible',
|
|
description:
|
|
'This will remove the selected the user from the project and all associated data.',
|
|
}}
|
|
>
|
|
<p className="text-sm text-foreground-light">
|
|
This is permanent! Are you sure you want to delete the user{' '}
|
|
{selectedUser?.email ?? selectedUser?.phone ?? 'this user'}?
|
|
</p>
|
|
</ConfirmationModal>
|
|
)
|
|
}
|