@@ -8,7 +8,7 @@ import Map from '../components/Map';
88import SeedNodeCard from '../components/SeedNodeCard' ;
99import ResourceChart from '../components/ResourceChart' ;
1010
11- export default function Home ( ) : React . JSX . Element {
11+ const Home = ( ) => {
1212 const { siteConfig } = useDocusaurusContext ( ) ;
1313 const nodesGeoQuery = useQuery < { [ nodeId : string ] : IpGeo } > ( {
1414 queryKey : [ 'nodesGeo' ] ,
@@ -77,23 +77,6 @@ export default function Home(): React.JSX.Element {
7777 libNetworkVersion : 'NetVer' ,
7878 } ;
7979
80- const versionMetadataKeysSorted = React . useMemo ( ( ) => {
81- if ( ! Array . isArray ( deploymentsQuery . data ) ) return [ ] ;
82-
83- const keySet = new Set < string > ( ) ;
84- for ( const deployment of deploymentsQuery . data ) {
85- if (
86- deployment &&
87- typeof deployment . versionMetadata === 'object' &&
88- deployment . versionMetadata != null
89- ) {
90- for ( const key of Object . keys ( deployment . versionMetadata ) ) {
91- keySet . add ( key ) ;
92- }
93- }
94- }
95- return Array . from ( keySet ) . sort ( ) ;
96- } , [ deploymentsQuery . data ] ) ;
9780 return (
9881 < Layout
9982 description = "Polykey, a new approach to secrets management."
@@ -110,23 +93,19 @@ export default function Home(): React.JSX.Element {
11093 < div className = "mx-auto max-w-6xl space-y-3 p-3" >
11194 < h1 className = "text-center text-2xl" > Seed Nodes</ h1 >
11295 < div className = "flex flex-wrap justify-center gap-3" >
113- { seedNodesQuery . data != null ? (
114- Object . entries ( seedNodesQuery . data ) . map ( ( [ nodeId , data ] ) => (
115- < SeedNodeCard
116- className = "min-w-0 shrink grow-[0.5]"
117- data = { data }
118- key = { nodeId }
119- nodeId = { nodeId }
120- />
121- ) )
122- ) : (
123- < > </ >
124- ) }
96+ { seedNodesQuery . data != null
97+ ? Object . entries ( seedNodesQuery . data ) . map ( ( [ nodeId , data ] ) => (
98+ < SeedNodeCard
99+ className = "min-w-0 shrink grow-[0.5]"
100+ data = { data }
101+ key = { nodeId }
102+ nodeId = { nodeId }
103+ />
104+ ) )
105+ : null }
125106 { seedNodesQuery . error != null ? (
126107 < > Unable to fetch seednodes status from Polykey-Network-Status</ >
127- ) : (
128- < > </ >
129- ) }
108+ ) : null }
130109 </ div >
131110 { resourceCpuQuery . error == null ||
132111 resourceMemoryQuery . error == null ? (
@@ -140,9 +119,7 @@ export default function Home(): React.JSX.Element {
140119 ) }
141120 title = "CPU Usage"
142121 />
143- ) : (
144- < > </ >
145- ) }
122+ ) : null }
146123 </ div >
147124 < div className = "inline-block aspect-[1.5] w-full md:w-1/2" >
148125 { resourceMemoryQuery . data != null ? (
@@ -153,14 +130,10 @@ export default function Home(): React.JSX.Element {
153130 ) }
154131 title = "Memory Usage"
155132 />
156- ) : (
157- < > </ >
158- ) }
133+ ) : null }
159134 </ div >
160135 </ div >
161- ) : (
162- < > </ >
163- ) }
136+ ) : null }
164137 < div className = "rounded-2xl bg-[#E4F6F2] p-3" >
165138 < span className = "font-semibold" > Deployments:</ span >
166139 < table className = "mt-3 w-full table-auto" >
@@ -287,4 +260,6 @@ export default function Home(): React.JSX.Element {
287260 </ div >
288261 </ Layout >
289262 ) ;
290- }
263+ } ;
264+
265+ export default Home ;
0 commit comments