do to formatters
This commit is contained in:
@@ -11,52 +11,41 @@ import { Input } from '@/ui/Input';
|
||||
import { Stack } from '@/ui/Stack';
|
||||
import { Text } from '@/ui/Text';
|
||||
import {
|
||||
Activity,
|
||||
AlertTriangle,
|
||||
Bug,
|
||||
ChevronDown,
|
||||
Clock,
|
||||
Copy,
|
||||
Cpu,
|
||||
Download,
|
||||
FileText,
|
||||
Globe,
|
||||
RefreshCw,
|
||||
Search,
|
||||
Terminal,
|
||||
Trash2,
|
||||
Zap
|
||||
Activity,
|
||||
AlertTriangle,
|
||||
Bug,
|
||||
ChevronDown,
|
||||
Clock,
|
||||
Copy,
|
||||
Cpu,
|
||||
Download,
|
||||
FileText,
|
||||
Globe,
|
||||
RefreshCw,
|
||||
Search,
|
||||
Terminal,
|
||||
Trash2,
|
||||
Zap
|
||||
} from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { DateDisplay } from '@/lib/display-objects/DateDisplay';
|
||||
import { DurationDisplay } from '@/lib/display-objects/DurationDisplay';
|
||||
import { MemoryDisplay } from '@/lib/display-objects/MemoryDisplay';
|
||||
import { PercentDisplay } from '@/lib/display-objects/PercentDisplay';
|
||||
import { TimeDisplay } from '@/lib/display-objects/TimeDisplay';
|
||||
import { DateFormatter } from '@/lib/formatters/DateFormatter';
|
||||
import { DurationFormatter } from '@/lib/formatters/DurationFormatter';
|
||||
import { MemoryFormatter } from '@/lib/formatters/MemoryFormatter';
|
||||
import { PercentFormatter } from '@/lib/formatters/PercentFormatter';
|
||||
|
||||
interface ErrorAnalyticsDashboardProps {
|
||||
/**
|
||||
* Auto-refresh interval in milliseconds
|
||||
*/
|
||||
refreshInterval?: number;
|
||||
/**
|
||||
* Whether to show in production (default: false)
|
||||
*/
|
||||
showInProduction?: boolean;
|
||||
}
|
||||
|
||||
function formatDuration(duration: number): string {
|
||||
return DurationDisplay.formatMs(duration);
|
||||
return DurationFormatter.formatMs(duration);
|
||||
}
|
||||
|
||||
function formatPercentage(value: number, total: number): string {
|
||||
if (total === 0) return '0%';
|
||||
return PercentDisplay.format(value / total);
|
||||
return PercentFormatter.format(value / total);
|
||||
}
|
||||
|
||||
function formatMemory(bytes: number): string {
|
||||
return MemoryDisplay.formatMB(bytes);
|
||||
return MemoryFormatter.formatMB(bytes);
|
||||
}
|
||||
|
||||
interface PerformanceWithMemory extends Performance {
|
||||
@@ -327,7 +316,7 @@ export function ErrorAnalyticsDashboard({
|
||||
<Stack display="flex" justifyContent="between" alignItems="start" gap={2} mb={1}>
|
||||
<Text size="xs" font="mono" weight="bold" color="text-red-400" truncate>{error.type}</Text>
|
||||
<Text size="xs" color="text-gray-500" fontSize="10px">
|
||||
{DateDisplay.formatTime(error.timestamp)}
|
||||
{DateFormatter.formatTime(error.timestamp)}
|
||||
</Text>
|
||||
</Stack>
|
||||
<Text size="xs" color="text-gray-300" block mb={1}>{error.message}</Text>
|
||||
|
||||
Reference in New Issue
Block a user