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