🐛 Fix bugs with async events from dockerode

This commit is contained in:
ajnart
2022-07-22 16:19:56 +02:00
parent a9b840452e
commit 7b719c2273
2 changed files with 32 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
import { Table, Checkbox, Group, Badge, createStyles, ScrollArea, TextInput } from '@mantine/core';
import { IconSearch } from '@tabler/icons';
import Dockerode from 'dockerode';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import ContainerState from './ContainerState';
const useStyles = createStyles((theme) => ({
@@ -26,6 +26,10 @@ export default function DockerTable({
const { classes, cx } = useStyles();
const [search, setSearch] = useState('');
useEffect(() => {
setContainers(containers);
}, [containers]);
const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const { value } = event.currentTarget;
setSearch(value);