@@ -158,16 +158,17 @@ function formatDate(dateString: string, locale: string): string {
158158}
159159
160160function getCurrentThawIndex ( schedule : Schedule ) : number {
161- const redeemableIndex = schedule . thaws . findIndex ( thaw => thaw . status === 'redeemable' ) ;
161+ const redeemableIndex = schedule . thaws . findIndex ( thaw => thaw . status === 'redeemable' || thaw . status === 'failed' ) ;
162162 if ( redeemableIndex >= 0 ) return redeemableIndex ;
163- const upcomingIndex = schedule . thaws . findIndex ( thaw => thaw . status === 'upcoming' ) ;
163+ const upcomingIndex = schedule . thaws . findIndex ( thaw => thaw . status === 'upcoming' || thaw . status === 'failed' ) ;
164164 if ( upcomingIndex >= 0 ) return upcomingIndex ;
165165 return 0 ;
166166}
167167
168- type ThawStatus = 'redeemable' | 'confirmed' | 'upcoming' ;
168+ type ThawStatus = 'redeemable' | 'confirmed' | 'upcoming' | 'failed' ;
169169
170170function getThawStatusType ( status : string ) : ThawStatus {
171+ if ( status === 'failed' ) return 'failed' ;
171172 if ( status === 'redeemable' ) return 'redeemable' ;
172173 if ( status === 'confirmed' ) return 'confirmed' ;
173174 return 'upcoming' ;
@@ -202,6 +203,8 @@ function getStatusMessage(status: ThawStatus, strings: ReturnType<typeof useStri
202203 return strings . redeemable ;
203204 case 'confirmed' :
204205 return strings . redeemed ;
206+ case 'failed' :
207+ return strings . failed ;
205208 default :
206209 return strings . notAvailable ;
207210 }
@@ -238,6 +241,7 @@ function ScheduleCard({ schedule }: { schedule: Schedule }) {
238241 const isCurrent = index === currentThawIndex ;
239242 const isPast = index < currentThawIndex ;
240243 const isLast = index === totalThaws - 1 ;
244+ const isFailed = thaw . status === 'failed' ;
241245
242246 return (
243247 < Box key = { index } sx = { { flex : 1 , position : 'relative' } } >
@@ -251,15 +255,30 @@ function ScheduleCard({ schedule }: { schedule: Schedule }) {
251255 display : 'flex' ,
252256 alignItems : 'center' ,
253257 justifyContent : 'center' ,
254- backgroundColor : isPast ? 'ds.primary_300' : isCurrent ? 'ds.primary_500' : 'ds.gray_200' ,
258+ backgroundColor : isFailed
259+ ? 'ds.gray_200'
260+ : isPast
261+ ? 'ds.primary_300'
262+ : isCurrent
263+ ? 'ds.primary_500'
264+ : 'ds.gray_200' ,
255265 color : isPast || isCurrent ? 'ds.white_static' : 'ds.text_gray_min' ,
256266 fontSize : '12px' ,
257267 fontWeight : 500 ,
258268 zIndex : 1 ,
259269 flexShrink : 0 ,
260270 } }
261271 >
262- { isPast ? (
272+ { isFailed ? (
273+ < svg xmlns = "http://www.w3.org/2000/svg" width = "14" height = "14" viewBox = "0 0 16 16" fill = "none" >
274+ < path
275+ fill-rule = "evenodd"
276+ clip-rule = "evenodd"
277+ d = "M4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L8 6.58579L10.2929 4.29289C10.6834 3.90237 11.3166 3.90237 11.7071 4.29289C12.0976 4.68342 12.0976 5.31658 11.7071 5.70711L9.41421 8L11.7071 10.2929C12.0976 10.6834 12.0976 11.3166 11.7071 11.7071C11.3166 12.0976 10.6834 12.0976 10.2929 11.7071L8 9.41421L5.70711 11.7071C5.31658 12.0976 4.68342 12.0976 4.29289 11.7071C3.90237 11.3166 3.90237 10.6834 4.29289 10.2929L6.58579 8L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289Z"
278+ fill = "#FF0000"
279+ />
280+ </ svg >
281+ ) : isPast ? (
263282 < Box sx = { { display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } >
264283 < svg xmlns = "http://www.w3.org/2000/svg" width = "14" height = "14" viewBox = "0 0 16 16" fill = "none" >
265284 < path
0 commit comments