@@ -189,9 +189,9 @@ export default function ObjectList({
189
189
190
190
const folders = filterObjectsByPrefix ( objects , folderPrefix ) ;
191
191
192
- const extractPath = ( url : string ) => {
192
+ const extractPath = ( url : string ) : string => {
193
193
const match = / h t t p s ? : \/ \/ [ ^ \/ ] + ( \/ .* ) $ / . exec ( url ) ;
194
- return match ? match [ 1 ] : url ;
194
+ return match ? match [ 1 ] ! : url ;
195
195
} ;
196
196
197
197
const generateS3Link = ( key : string ) => {
@@ -206,12 +206,12 @@ export default function ObjectList({
206
206
placeholder = "Search..."
207
207
value = { searchQuery }
208
208
onChange = { handleSearch }
209
- className = "bg-input w-[250px] rounded border border-primary p-2 text-primary"
209
+ className = "w-[250px] rounded border border-primary bg-input p-2 text-primary"
210
210
/>
211
211
< select
212
212
value = { selectedFolder ?? "" }
213
213
onChange = { handleFolderChange }
214
- className = "bg-input ml-2 w-[250px] cursor-pointer rounded border border-primary p-2 text-primary"
214
+ className = "ml-2 w-[250px] cursor-pointer rounded border border-primary bg-input p-2 text-primary"
215
215
>
216
216
{ folders . map ( ( folder , index ) => (
217
217
< option key = { index } value = { folder } >
@@ -310,9 +310,7 @@ export default function ObjectList({
310
310
rel = "noopener noreferrer"
311
311
className = "text-link hover:underline"
312
312
>
313
- { type === "server"
314
- ? object . key . split ( "/" ) . pop ( )
315
- : object . key }
313
+ { object . key }
316
314
</ a >
317
315
</ td >
318
316
{ type === "server" && (
@@ -323,7 +321,7 @@ export default function ObjectList({
323
321
rel = "noopener noreferrer"
324
322
className = "text-link hover:underline"
325
323
>
326
- { extractPath ( object . url ) }
324
+ { extractPath ( object . url ) . split ( "/" ) . pop ( ) }
327
325
</ a >
328
326
</ td >
329
327
) }
@@ -340,7 +338,7 @@ export default function ObjectList({
340
338
< button
341
339
onClick = { handleDeleteSelected }
342
340
disabled = { selectedObjects . length === 0 }
343
- className = "bg-button-destroy disabled:bg-gradient-button-disabled disabled:text-disabled ml-auto mt-4 flex rounded px-4 py-2 font-bold text-primary disabled:opacity-50"
341
+ className = "ml-auto mt-4 flex rounded bg-button-destroy px-4 py-2 font-bold text-primary disabled:bg-gradient-button-disabled disabled:text-disabled disabled:opacity-50"
344
342
>
345
343
Delete Selected
346
344
</ button >
@@ -350,7 +348,7 @@ export default function ObjectList({
350
348
setCurrentPage ( ( prevPage ) => Math . max ( prevPage - 1 , 1 ) )
351
349
}
352
350
disabled = { currentPage === 1 }
353
- className = "bg-gradient-button disabled:bg-gradient-button-disabled disabled:text-disabled w-[120px] rounded px-4 py-2 font-bold text-primary disabled:opacity-50"
351
+ className = "w-[120px] rounded bg-gradient-button px-4 py-2 font-bold text-primary disabled:bg-gradient-button-disabled disabled:text-disabled disabled:opacity-50"
354
352
>
355
353
Previous
356
354
</ button >
@@ -362,7 +360,7 @@ export default function ObjectList({
362
360
setCurrentPage ( ( prevPage ) => Math . min ( prevPage + 1 , totalPages ) )
363
361
}
364
362
disabled = { currentPage === totalPages }
365
- className = "bg-gradient-button disabled:bg-gradient-button-disabled disabled:text-disabled w-[120px] rounded px-4 py-2 font-bold text-primary disabled:opacity-50"
363
+ className = "w-[120px] rounded bg-gradient-button px-4 py-2 font-bold text-primary disabled:bg-gradient-button-disabled disabled:text-disabled disabled:opacity-50"
366
364
>
367
365
Next
368
366
</ button >
0 commit comments