@@ -31,43 +31,7 @@ import { systemApi } from '../api';
3131import type { SandboxStatus , DatabaseStatus , BackupInfo , DatabaseStats } from '../api' ;
3232import type { ToolDependenciesResponse } from '../api/endpoints/misc' ;
3333import { PageHomeTab } from '../components/PageHomeTab' ;
34-
35- // Helper to format uptime
36- function formatUptime ( seconds : number ) : string {
37- const days = Math . floor ( seconds / 86400 ) ;
38- const hours = Math . floor ( ( seconds % 86400 ) / 3600 ) ;
39- const minutes = Math . floor ( ( seconds % 3600 ) / 60 ) ;
40- const secs = Math . floor ( seconds % 60 ) ;
41-
42- const parts : string [ ] = [ ] ;
43- if ( days > 0 ) parts . push ( `${ days } d` ) ;
44- if ( hours > 0 ) parts . push ( `${ hours } h` ) ;
45- if ( minutes > 0 ) parts . push ( `${ minutes } m` ) ;
46- if ( secs > 0 || parts . length === 0 ) parts . push ( `${ secs } s` ) ;
47-
48- return parts . join ( ' ' ) ;
49- }
50-
51- // Category color map for tool dependency badges
52- const CATEGORY_COLORS : Record < string , string > = {
53- Email : 'bg-blue-500/10 text-blue-600 dark:text-blue-400' ,
54- Image : 'bg-purple-500/10 text-purple-600 dark:text-purple-400' ,
55- PDF : 'bg-red-500/10 text-red-600 dark:text-red-400' ,
56- Audio : 'bg-green-500/10 text-green-600 dark:text-green-400' ,
57- 'Coding Agents' : 'bg-orange-500/10 text-orange-600 dark:text-orange-400' ,
58- } ;
59-
60- // Tables available for CSV export/import
61- const CSV_TABLES = [
62- 'expenses' ,
63- 'habits' ,
64- 'bookmarks' ,
65- 'notes' ,
66- 'tasks' ,
67- 'contacts' ,
68- 'calendar_events' ,
69- 'captures' ,
70- ] as const ;
34+ import { formatUptime , CATEGORY_COLORS , CSV_TABLES } from './SystemPage.constants' ;
7135
7236export function SystemPage ( ) {
7337 const [ searchParams ] = useSearchParams ( ) ;
0 commit comments