import Button from "~/components/Button"; import { useModal } from "~/providers/modal"; import { usePopup } from "~/providers/popup"; import { api } from "~/utils/api"; interface DeleteListConfirmationProps { listPublicId: string; queryParams: QueryParams; } interface QueryParams { boardPublicId: string; members: string[]; labels: string[]; } export function DeleteListConfirmation({ listPublicId, queryParams, }: DeleteListConfirmationProps) { const utils = api.useUtils(); const { closeModal } = useModal(); const { showPopup } = usePopup(); const deleteList = api.list.delete.useMutation({ onError: () => { showPopup({ header: "Unable to delete list", message: "Please try again later, or contact customer support.", icon: "error", }); }, onSettled: async () => { closeModal(); await utils.board.byId.invalidate(queryParams); }, }); return (

Are you sure you want to delete this list?

{"This action can't be undone."}

); }