@@ -95,12 +95,14 @@ function ActivityFeed() {
9595 ) ;
9696}
9797
98- function CleanupFlyout ( { onClose, onCleanup } : { onClose : ( ) => void ; onCleanup : ( ) => Promise < void > } ) {
98+ function CleanupFlyout ( { onClose, onCleanup, totalCount } : { onClose : ( ) => void ; onCleanup : ( ) => Promise < void > ; totalCount ?: number } ) {
9999 const { data : items , isLoading } = useQuery ( {
100100 queryKey : [ 'admin-soft-deleted' ] ,
101101 queryFn : adminApi . getSoftDeleted ,
102102 } ) ;
103103
104+ const displayTotal = totalCount ?? items ?. length ?? 0 ;
105+
104106 return (
105107 < div className = "fixed inset-0 z-50 flex justify-end" style = { { background : 'rgba(0,0,0,0.5)' } } onClick = { onClose } >
106108 < div
@@ -112,7 +114,7 @@ function CleanupFlyout({ onClose, onCleanup }: { onClose: () => void; onCleanup:
112114 < div className = "flex items-center justify-between px-4 py-3 flex-shrink-0" style = { { borderBottom : '1px solid #30363d' } } >
113115 < h3 className = "text-sm font-medium flex items-center gap-2" style = { { color : '#e6edf3' } } >
114116 < Trash2 size = { 16 } style = { { color : '#fbbf24' } } />
115- Pending Cleanup ({ items ?. length ?? 0 } items)
117+ Pending Cleanup ({ displayTotal } items)
116118 </ h3 >
117119 < div className = "flex items-center gap-2" >
118120 < button
@@ -135,21 +137,21 @@ function CleanupFlyout({ onClose, onCleanup }: { onClose: () => void; onCleanup:
135137 ) : ! items ?. length ? (
136138 < div className = "py-10 text-center" style = { { color : '#8b949e' } } > No soft-deleted items</ div >
137139 ) : (
138- < table className = "w-full" >
140+ < table className = "w-full" style = { { tableLayout : 'fixed' } } >
139141 < thead >
140142 < tr style = { { borderBottom : '1px solid #30363d' , color : '#8b949e' , position : 'sticky' , top : 0 , background : '#0d1117' } } >
141- < th className = "text-left px-3 py-2 font-normal" > File</ th >
142- < th className = "text-left px-3 py-2 font-normal" > Type</ th >
143- < th className = "text-left px-3 py-2 font-normal" > Size</ th >
144- < th className = "text-left px-3 py-2 font-normal" > Status</ th >
145- < th className = "text-left px-3 py-2 font-normal" > Thumb</ th >
146- < th className = "text-left px-3 py-2 font-normal" > Deleted</ th >
143+ < th className = "text-left px-3 py-2 font-normal" style = { { width : '35%' } } > File</ th >
144+ < th className = "text-left px-3 py-2 font-normal" style = { { width : '10%' } } > Type</ th >
145+ < th className = "text-left px-3 py-2 font-normal" style = { { width : '10%' } } > Size</ th >
146+ < th className = "text-left px-3 py-2 font-normal" style = { { width : '12%' } } > Status</ th >
147+ < th className = "text-left px-3 py-2 font-normal" style = { { width : '8%' } } > Thumb</ th >
148+ < th className = "text-left px-3 py-2 font-normal" style = { { width : '25%' } } > Deleted</ th >
147149 </ tr >
148150 </ thead >
149151 < tbody >
150152 { items . map ( ( item ) => (
151153 < tr key = { item . id } style = { { borderBottom : '1px solid #21262d' } } >
152- < td className = "px-3 py-1.5 truncate max-w-[220px] " style = { { color : '#e6edf3' } } > { item . fileName } </ td >
154+ < td className = "px-3 py-1.5 truncate" style = { { color : '#e6edf3' } } > { item . fileName } </ td >
153155 < td className = "px-3 py-1.5" style = { { color : '#8b949e' } } > { item . contentType . split ( '/' ) [ 1 ] || item . contentType } </ td >
154156 < td className = "px-3 py-1.5" style = { { color : '#8b949e' } } > { item . sizeMB } MB</ td >
155157 < td className = "px-3 py-1.5" >
@@ -165,6 +167,11 @@ function CleanupFlyout({ onClose, onCleanup }: { onClose: () => void; onCleanup:
165167 ) ) }
166168 </ tbody >
167169 </ table >
170+ { items . length < displayTotal && (
171+ < div className = "px-3 py-2 text-[10px] text-center" style = { { color : '#484f58' , borderTop : '1px solid #21262d' } } >
172+ Showing { items . length } of { displayTotal } items
173+ </ div >
174+ ) }
168175 ) }
169176 </ div >
170177 </ div >
@@ -432,7 +439,7 @@ export function AdminPage() {
432439 ) }
433440
434441 { /* Soft-Deleted Items Flyout */ }
435- { showCleanupFlyout && < CleanupFlyout onClose = { ( ) => setShowCleanupFlyout ( false ) } onCleanup = { handleTriggerCleanup } /> }
442+ { showCleanupFlyout && < CleanupFlyout onClose = { ( ) => setShowCleanupFlyout ( false ) } onCleanup = { handleTriggerCleanup } totalCount = { stats ?. softDeleted } /> }
436443 </ div >
437444 ) ;
438445}
0 commit comments