11import React , { useEffect , useState } from 'react' ;
22import { useTranslation } from 'react-i18next' ;
33
4- import { Cards , Header , PropertyFilter , SelectCSD , StatusIndicator } from 'components' ;
4+ import { Cards , Header , Link , PropertyFilter , SelectCSD , StatusIndicator } from 'components' ;
55
66import { useCollection } from 'hooks' ;
77import { useGetGpusListQuery } from 'services/gpu' ;
@@ -12,7 +12,7 @@ import { convertMiBToGB, rangeToObject, renderRange, round } from './helpers';
1212
1313import styles from './styles.module.scss' ;
1414
15- const gpusFilterOption = { label : 'GPUs ' , value : 'gpu' } ;
15+ const gpusFilterOption = { label : 'GPU ' , value : 'gpu' } ;
1616
1717const getRequestParams = ( {
1818 project_name,
@@ -111,38 +111,38 @@ export const OfferList = () => {
111111 { ...collectionProps }
112112 items = { items }
113113 cardDefinition = { {
114- header : ( gpu ) => gpu . name ,
114+ header : ( gpu ) => < Link > { gpu . name } </ Link > ,
115115 sections : [
116116 {
117- id : 'backends ' ,
118- header : t ( 'offer.backend_plural ' ) ,
119- content : ( gpu ) => gpu . backends ?. join ( ', ' ) ?? '-' ,
117+ id : 'memory_mib ' ,
118+ header : t ( 'offer.memory_mib ' ) ,
119+ content : ( gpu ) => ` ${ round ( convertMiBToGB ( gpu . memory_mib ) ) } GB` ,
120120 width : 50 ,
121121 } ,
122- // {
123- // id: 'region',
124- // header: t('offer.region'),
125- // content: (gpu) => gpu.region ?? gpu.regions?.join(', ') ?? '-',
126- // width: 50,
127- // },
128122 {
129- id : 'count ' ,
130- header : t ( 'offer.count ' ) ,
131- content : ( gpu ) => renderRange ( gpu . count ) ?? '-' ,
123+ id : 'price ' ,
124+ header : t ( 'offer.price ' ) ,
125+ content : ( gpu ) => < span className = { styles . greenText } > { renderRange ( gpu . price ) ?? '-' } </ span > ,
132126 width : 50 ,
133127 } ,
134128 {
135- id : 'price ' ,
136- header : t ( 'offer.price ' ) ,
137- content : ( gpu ) => renderRange ( gpu . price ) ?? '-' ,
129+ id : 'count ' ,
130+ header : t ( 'offer.count ' ) ,
131+ content : ( gpu ) => renderRange ( gpu . count ) ?? '-' ,
138132 width : 50 ,
139133 } ,
140134 {
141- id : 'memory_mib ' ,
142- header : t ( 'offer.memory_mib ' ) ,
143- content : ( gpu ) => ` ${ round ( convertMiBToGB ( gpu . memory_mib ) ) } GB` ,
135+ id : 'backends ' ,
136+ header : t ( 'offer.backend_plural ' ) ,
137+ content : ( gpu ) => gpu . backends ?. join ( ', ' ) ?? '-' ,
144138 width : 50 ,
145139 } ,
140+ // {
141+ // id: 'region',
142+ // header: t('offer.region'),
143+ // content: (gpu) => gpu.region ?? gpu.regions?.join(', ') ?? '-',
144+ // width: 50,
145+ // },
146146 {
147147 id : 'spot' ,
148148 header : t ( 'offer.spot' ) ,
@@ -152,8 +152,10 @@ export const OfferList = () => {
152152 {
153153 id : 'availability' ,
154154 content : ( gpu ) => {
155+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
156+ // @ts -expect-error
155157 if ( gpu . availability === 'not_available' ) {
156- return < StatusIndicator type = "error " > Not Available</ StatusIndicator > ;
158+ return < StatusIndicator type = "warning " > Not Available</ StatusIndicator > ;
157159 }
158160 } ,
159161 width : 50 ,
@@ -164,6 +166,7 @@ export const OfferList = () => {
164166 loadingText = { t ( 'common.loading' ) }
165167 stickyHeader = { true }
166168 header = { < Header variant = "awsui-h1-sticky" > { t ( 'offer.title' ) } </ Header > }
169+ variant = "full-page"
167170 filter = {
168171 < div className = { styles . selectFilters } >
169172 < div className = { styles . propertyFilter } >
0 commit comments