From 8de619c5a0899f1eff2d74b003480891f740e2c0 Mon Sep 17 00:00:00 2001
From: Wolfboy248 <georgejvindkarlsen@gmail.com>
Date: Tue, 22 Oct 2024 09:34:52 +0200
Subject: refactor: hook updated

---
 frontend/src/hooks/UseConfirm.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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

diff --git a/frontend/src/hooks/UseConfirm.tsx b/frontend/src/hooks/UseConfirm.tsx
index 6de7b10..80a0d51 100644
--- a/frontend/src/hooks/UseConfirm.tsx
+++ b/frontend/src/hooks/UseConfirm.tsx
@@ -1,12 +1,16 @@
 import React, { useState } from 'react';
 import ConfirmDialog from '../components/ConfirmDialog';
 
-const useConfirm = ( title: string, subtitle: string ) => {
+const useConfirm = () => {
     const [isOpen, setIsOpen] = useState(false);
     const [resolvePromise, setResolvePromise] = useState<((value: boolean) => void) | null>(null);
+	const [title, setTitle] = useState<string>("");
+	const [subtitle, setSubtitle] = useState<string>("");
 
-    const confirm = () => {
+    const confirm = ( titleN: string, subtitleN: string ) => {
         setIsOpen(true);
+		setTitle(titleN);
+		setSubtitle(subtitleN);
         return new Promise((resolve) => {
             setResolvePromise(() => resolve);
         });
-- 
cgit v1.2.3

