Loaders and delete user confirmation

This commit is contained in:
Valentino Kozinec 2022-02-11 12:45:22 +01:00
parent 9f734ec474
commit f034706bbb
10 changed files with 240 additions and 152 deletions

View file

@ -7,9 +7,10 @@ type ConfirmationModalProps = {
onClose: () => void;
title: string;
body: string;
onDeleteAction?: () => void;
};
export const ConfirmationModal = ({ open, onClose, title, body }: ConfirmationModalProps) => {
export const ConfirmationModal = ({ open, onClose, title, body, onDeleteAction }: ConfirmationModalProps) => {
const cancelButtonRef = useRef(null);
return (
@ -67,7 +68,7 @@ export const ConfirmationModal = ({ open, onClose, title, body }: ConfirmationMo
<button
type="button"
className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"
onClick={onClose}
onClick={onDeleteAction}
>
Delete
</button>