Bug fixes

This commit is contained in:
Sean Edmunds
2025-04-03 13:57:08 -05:00
parent 6493a458ff
commit d232a7bdb0
13 changed files with 77 additions and 35 deletions

View File

@@ -15,7 +15,7 @@ import { FiTrash } from 'react-icons/fi';
import { cardClasses, textInputClasses } from 'styles';
import DeleteItemModal from '../Shared/DeleteItemModal';
function DebouncedWolClient({ wolClient }: any) {
function DebouncedWolClient({ wolClient, setIsOpen }: any) {
const { theme, handleDelete } = useCommonHooks();
const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);
const { mutateAsync } = useMutationAPI();
@@ -23,6 +23,10 @@ function DebouncedWolClient({ wolClient }: any) {
const [client, setClient] = useState<any>(wolClient);
const [update, setUpdate] = useState({});
const [debounced] = useDebouncedValue(update, 1000);
const handleClose = () => {
setIsOpen(false);
closeModal();
};
useEffect(() => {
if (Object.keys(debounced).length) {
@@ -40,7 +44,7 @@ function DebouncedWolClient({ wolClient }: any) {
<Card className={cardClasses.settingsItem} classNames={cardClasses}>
<DeleteItemModal
modalOpened={modalOpened}
handleClose={closeModal}
handleClose={handleClose}
title={'Delete WoL Client'}
body={
<Stack gap={0} w={'100%'} h={'150px'} align='center'>
@@ -63,7 +67,7 @@ function DebouncedWolClient({ wolClient }: any) {
styles={{ label: { color: 'black' } }}
onClick={() => {
handleDelete(client, 'api/WolClients');
closeModal();
handleClose();
}}
>
Delete
@@ -71,9 +75,7 @@ function DebouncedWolClient({ wolClient }: any) {
<Button
color={'grey'}
styles={{ label: { color: 'black' } }}
onClick={() => {
closeModal();
}}
onClick={handleClose}
>
Cancel
</Button>