mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Migrate all modals to ts
This commit is contained in:
44
app/src/components/modals/user/DeleteUserModal.tsx
Normal file
44
app/src/components/modals/user/DeleteUserModal.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import React from 'react';
|
||||
import { Modal, Text, Button, Group, Stack } from '@mantine/core';
|
||||
import { User } from '@/types/authApi';
|
||||
|
||||
interface DeleteUserModalProps {
|
||||
opened: boolean;
|
||||
onClose: () => void;
|
||||
onConfirm: () => Promise<void>;
|
||||
user: User | null;
|
||||
loading: boolean;
|
||||
}
|
||||
|
||||
const DeleteUserModal: React.FC<DeleteUserModalProps> = ({
|
||||
opened,
|
||||
onClose,
|
||||
onConfirm,
|
||||
user,
|
||||
loading,
|
||||
}) => (
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
title="Delete User"
|
||||
centered
|
||||
size="sm"
|
||||
>
|
||||
<Stack>
|
||||
<Text>
|
||||
Are you sure you want to delete user "{user?.email}"? This action cannot
|
||||
be undone and all associated data will be permanently deleted.
|
||||
</Text>
|
||||
<Group justify="flex-end" mt="xl">
|
||||
<Button variant="default" onClick={onClose}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button color="red" onClick={onConfirm} loading={loading}>
|
||||
Delete User
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
export default DeleteUserModal;
|
||||
Reference in New Issue
Block a user