0 ? tw`mt-2 overflow-x-auto` : tw`overflow-x-auto`}
+ >
+
+
+
+
+ {allocation.alias || allocation.ip}
+
+
+
+ {allocation.port}
+
+
+
+
+
+
+
+ {allocation.isDefault ?
+ Primary
+ :
+
+
+
+ }
+
+
+ );
+};
+
+export default memo(AllocationRow, isEqual);
diff --git a/resources/scripts/components/server/network/NetworkContainer.tsx b/resources/scripts/components/server/network/NetworkContainer.tsx
index 0bec04274..1cbab974d 100644
--- a/resources/scripts/components/server/network/NetworkContainer.tsx
+++ b/resources/scripts/components/server/network/NetworkContainer.tsx
@@ -1,37 +1,32 @@
-import React, { useEffect, useState } from 'react';
-import tw from 'twin.macro';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faNetworkWired } from '@fortawesome/free-solid-svg-icons';
-import styled from 'styled-components/macro';
-import GreyRowBox from '@/components/elements/GreyRowBox';
-import Button from '@/components/elements/Button';
-import Can from '@/components/elements/Can';
+import React, { useCallback, useEffect } from 'react';
import useSWR from 'swr';
import getServerAllocations from '@/api/server/network/getServerAllocations';
import { Allocation } from '@/api/server/getServer';
import Spinner from '@/components/elements/Spinner';
-import setPrimaryServerAllocation from '@/api/server/network/setPrimaryServerAllocation';
import useFlash from '@/plugins/useFlash';
-import { Textarea } from '@/components/elements/Input';
-import setServerAllocationNotes from '@/api/server/network/setServerAllocationNotes';
-import { debounce } from 'debounce';
-import InputSpinner from '@/components/elements/InputSpinner';
import ServerContentBlock from '@/components/elements/ServerContentBlock';
import { ServerContext } from '@/state/server';
import { useDeepMemoize } from '@/plugins/useDeepMemoize';
-
-const Code = styled.code`${tw`font-mono py-1 px-2 bg-neutral-900 rounded text-sm block`}`;
-const Label = styled.label`${tw`uppercase text-xs mt-1 text-neutral-400 block px-1 select-none transition-colors duration-150`}`;
+import AllocationRow from '@/components/server/network/AllocationRow';
+import setPrimaryServerAllocation from '@/api/server/network/setPrimaryServerAllocation';
const NetworkContainer = () => {
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
const allocations = useDeepMemoize(ServerContext.useStoreState(state => state.server.data!.allocations));
const { clearFlashes, clearAndAddHttpError } = useFlash();
- const [ loading, setLoading ] = useState