From 06734c95fffd58ba9e1dba6be6a3ffb4c1884a06 Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 24 May 2024 10:25:50 +0800 Subject: [PATCH] Confirmation for the Delete button --- src/components/Lists.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/components/Lists.js b/src/components/Lists.js index d27143c..b3cf4d5 100644 --- a/src/components/Lists.js +++ b/src/components/Lists.js @@ -1,13 +1,16 @@ import React, { useState,useEffect } from 'react'; -import { Button, Table } from '@mantine/core'; +import { Dialog, Button, Table, Text, Group } from '@mantine/core'; import { Link } from 'react-router-dom'; import {http} from "../middleware/axiosConfig"; +import { useDisclosure } from '@mantine/hooks'; const List = () => { // Initialize state for user data const [ userData, setUserData] = useState([]); + const [opened, { toggle, close }] = useDisclosure(false); + //useEffect hook - useEffect(() => { fetchData(); @@ -60,14 +63,30 @@ const List = () => { {/* Action.View Button - triggers the View module */} - + {/* Action.Edit Button - triggers the Edit module */} - + {/* Delete Button - triggers the handleDelete function */} - + {/* */} + + + + Are you sure you want to Delete this account? + + + + + )})