import { DeleteConfirmation } from '@marzneshin/components' import { type FC, useEffect } from 'react' import { HostType, useHostsDeletionMutation } from '@marzneshin/features/hosts' interface HostsDeleteConfirmationDialogProps { onOpenChange: (state: boolean) => void onClose: () => void open: boolean entity: HostType } export const HostsDeleteConfirmationDialog: FC = ({ onOpenChange, open, entity, onClose }) => { const deleteMutation = useHostsDeletionMutation(); useEffect(() => { if (!open) onClose(); }, [open, onClose]); return ( deleteMutation.mutate(entity)} /> ) }