gitscope
← marzneshin / v0.3.0-alpha2 / dashboard/src/features/users/dialogs/delete-confirmation/index.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/users/dialogs/delete-confirmation/index.tsx · TypeScript
Blame Raw
 1
 2import { DeleteConfirmation } from '@marzneshin/components'
 3import { FC } from 'react'
 4import { UserMutationType, useUsersDeletionMutation } from '@marzneshin/features/users'
 5
 6interface UsersDeleteConfirmationDialogProps {
 7    onOpenChange: (state: boolean) => void
 8    open: boolean
 9    entity: UserMutationType | null
10}
11
12export const UsersDeleteConfirmationDialog: FC<UsersDeleteConfirmationDialogProps> = ({ onOpenChange, open, entity }) => {
13    const deleteMutation = useUsersDeletionMutation();
14    if (entity !== null) {
15        return (
16            <DeleteConfirmation
17                open={open}
18                onOpenChange={onOpenChange}
19                action={() => deleteMutation.mutate(entity)}
20            />
21        )
22    }
23}