mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-01 19:26:30 +02:00
25 lines
628 B
TypeScript
25 lines
628 B
TypeScript
import { useModal } from "../modal";
|
|
import { useDeleteParticipantMutation } from "./mutations";
|
|
|
|
export const useDeleteParticipantModal = (
|
|
pollId: string,
|
|
participantId: string,
|
|
) => {
|
|
const { mutate: deleteParticipant } = useDeleteParticipantMutation(pollId);
|
|
return useModal({
|
|
title: "Delete participant?",
|
|
description:
|
|
"Are you sure you want to remove this participant from the poll?",
|
|
okButtonProps: {
|
|
type: "danger",
|
|
},
|
|
okText: "Remove",
|
|
onOk: () => {
|
|
deleteParticipant({
|
|
pollId: pollId,
|
|
participantId,
|
|
});
|
|
},
|
|
cancelText: "Cancel",
|
|
});
|
|
};
|