diff --git a/src/components/ConfirmModal.tsx b/src/components/ConfirmModal.tsx index 535027c..2b18db6 100644 --- a/src/components/ConfirmModal.tsx +++ b/src/components/ConfirmModal.tsx @@ -1,7 +1,6 @@ import {Button, Group, Modal, ModalProps, Text} from "@mantine/core"; import {useDisclosure} from "@mantine/hooks"; import {IconAlertTriangle} from "@tabler/icons-react"; -import {useState} from "react"; /** @@ -13,19 +12,17 @@ import {useState} from "react"; * @param onCancel - the function to call when the user cancels (optional) * @param props - additional props for the modal */ -export const useConfirmModal = ( +export const useConfirmModal = ( {title, description, onConfirm, onCancel, ...props}: { title?: string, description: string, - onConfirm: (t?: T) => void, + onConfirm: () => void, onCancel?: () => void } & Omit ) => { const [showConfirmModal, handler] = useDisclosure(false) - const [data, setData] = useState(undefined) - const ConfirmModal = () => { return <> ( onClick={() => { handler.close() onCancel?.() - setData(undefined) }}> Abbrechen