New settings pages
This commit is contained in:
41
src/pages/settings/components/WoL/WolClients.tsx
Normal file
41
src/pages/settings/components/WoL/WolClients.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import { Stack, Text } from '@mantine/core';
|
||||
import { DataTable, WolClientColumns } from 'components';
|
||||
import { useQueryAPI } from 'hooks';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { textClasses } from 'styles';
|
||||
|
||||
const WolClientSettings = () => {
|
||||
const endpoint = 'api/wolClients';
|
||||
const {
|
||||
data: wolClientsData,
|
||||
isFetched: wolClientsIsFetched,
|
||||
isFetching: wolClientsIsFetching,
|
||||
isLoading: wolClientsIsLoading,
|
||||
} = useQueryAPI({
|
||||
endpoint: endpoint,
|
||||
});
|
||||
const [wolClients, setWolClients] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (wolClientsData && wolClientsIsFetched) {
|
||||
setWolClients(wolClientsData);
|
||||
}
|
||||
}, [wolClientsData, wolClientsIsFetched]);
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
<Text className={textClasses.settingsSubTitle} classNames={textClasses}>
|
||||
WoL Clients
|
||||
</Text>
|
||||
<DataTable
|
||||
tableName='WoL Clients'
|
||||
columns={WolClientColumns()}
|
||||
tableData={wolClients}
|
||||
isFetching={wolClientsIsFetching}
|
||||
isLoading={wolClientsIsLoading}
|
||||
endpoint={endpoint}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
export default WolClientSettings;
|
||||
Reference in New Issue
Block a user