From 1c51ea2e373dcdd458d8cdc1d3b2225c316f346d Mon Sep 17 00:00:00 2001
From: Wolfboy248 <105884620+Wolfboy248@users.noreply.github.com>
Date: Sun, 20 Oct 2024 16:51:43 +0200
Subject: refactor: touch ups

---
 frontend/src/components/UseConfirm.tsx | 36 ----------------------------------
 1 file changed, 36 deletions(-)
 delete mode 100644 frontend/src/components/UseConfirm.tsx

(limited to 'frontend/src/components/UseConfirm.tsx')

diff --git a/frontend/src/components/UseConfirm.tsx b/frontend/src/components/UseConfirm.tsx
deleted file mode 100644
index 2fe0e12..0000000
--- a/frontend/src/components/UseConfirm.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React, { useState } from 'react';
-import ConfirmDialog from './ConfirmDialog';
-
-const useConfirm = ( title: string, subtitle: string ) => {
-    const [isOpen, setIsOpen] = useState(false);
-    const [resolvePromise, setResolvePromise] = useState<((value: boolean) => void) | null>(null);
-
-    const confirm = () => {
-        setIsOpen(true);
-        return new Promise((resolve) => {
-            setResolvePromise(() => resolve);
-        });
-    };
-
-    const handleConfirm = () => {
-        setIsOpen(false);
-        if (resolvePromise) {
-            resolvePromise(true);
-        }
-    }
-
-    const handleCancel = () => {
-        setIsOpen(false);
-        if (resolvePromise) {
-            resolvePromise(false);
-        }
-    }
-
-    const ConfirmDialogComponent = isOpen && (
-        <ConfirmDialog title={title} subtitle={subtitle} onConfirm={handleConfirm} onCancel={handleCancel}></ConfirmDialog>
-    );
-
-    return { confirm, ConfirmDialogComponent };
-}
-
-export default useConfirm;
-- 
cgit v1.2.3

