website refactor
This commit is contained in:
@@ -8,6 +8,8 @@ import { Text } from '@/ui/Text';
|
||||
import { FloatingAction } from '@/ui/FloatingAction';
|
||||
import { DebugPanel } from '@/ui/DebugPanel';
|
||||
import { StatGrid } from '@/ui/StatGrid';
|
||||
import { Stack } from '@/ui/Stack';
|
||||
import { ButtonGroup } from '@/ui/ButtonGroup';
|
||||
import { Bug, Shield } from 'lucide-react';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
@@ -207,13 +209,13 @@ export function DebugModeToggle({ show }: DebugModeToggleProps) {
|
||||
onClose={() => setIsOpen(false)}
|
||||
icon={<Icon icon={Bug} size={4} intent="success" />}
|
||||
>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
|
||||
<Stack gap={4}>
|
||||
{/* Debug Toggle */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '0.5rem', backgroundColor: 'var(--ui-color-bg-surface-muted)', borderRadius: '0.5rem' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
||||
<Stack align="center" justify="between">
|
||||
<ButtonGroup gap={2}>
|
||||
<Icon icon={Shield} size={4} intent={debugEnabled ? 'success' : 'low'} />
|
||||
<Text size="sm" weight="medium">Debug Mode</Text>
|
||||
</div>
|
||||
</ButtonGroup>
|
||||
<Button
|
||||
onClick={toggleDebug}
|
||||
size="sm"
|
||||
@@ -221,7 +223,7 @@ export function DebugModeToggle({ show }: DebugModeToggleProps) {
|
||||
>
|
||||
{debugEnabled ? 'ON' : 'OFF'}
|
||||
</Button>
|
||||
</div>
|
||||
</Stack>
|
||||
|
||||
{/* Metrics */}
|
||||
{debugEnabled && (
|
||||
@@ -238,41 +240,41 @@ export function DebugModeToggle({ show }: DebugModeToggleProps) {
|
||||
|
||||
{/* Actions */}
|
||||
{debugEnabled && (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.5rem' }}>
|
||||
<Stack gap={2}>
|
||||
<Text size="xs" weight="semibold" variant="low" uppercase>Test Actions</Text>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '0.5rem' }}>
|
||||
<Button onClick={triggerTestError} variant="danger" size="sm">Test Error</Button>
|
||||
<Button onClick={triggerTestApiCall} size="sm">Test API</Button>
|
||||
</div>
|
||||
<ButtonGroup gap={2}>
|
||||
<Button onClick={triggerTestError} variant="danger" size="sm" fullWidth>Test Error</Button>
|
||||
<Button onClick={triggerTestApiCall} size="sm" fullWidth>Test API</Button>
|
||||
</ButtonGroup>
|
||||
|
||||
<Text size="xs" weight="semibold" variant="low" uppercase style={{ marginTop: '0.5rem' }}>Utilities</Text>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '0.5rem' }}>
|
||||
<Button onClick={copyDebugInfo} variant="secondary" size="sm">Copy Info</Button>
|
||||
<Button onClick={clearAllLogs} variant="secondary" size="sm">Clear Logs</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Text size="xs" weight="semibold" variant="low" uppercase>Utilities</Text>
|
||||
<ButtonGroup gap={2}>
|
||||
<Button onClick={copyDebugInfo} variant="secondary" size="sm" fullWidth>Copy Info</Button>
|
||||
<Button onClick={clearAllLogs} variant="secondary" size="sm" fullWidth>Clear Logs</Button>
|
||||
</ButtonGroup>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
{/* Quick Links */}
|
||||
{debugEnabled && (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem' }}>
|
||||
<Stack gap={1}>
|
||||
<Text size="xs" weight="semibold" variant="low" uppercase>Quick Access</Text>
|
||||
<div style={{ fontSize: '10px', color: 'var(--ui-color-text-low)', fontFamily: 'var(--ui-font-mono)' }}>
|
||||
<div>• window.__GRIDPILOT_GLOBAL_HANDLER__</div>
|
||||
<div>• window.__GRIDPILOT_API_LOGGER__</div>
|
||||
<div>• window.__GRIDPILOT_REACT_ERRORS__</div>
|
||||
</div>
|
||||
</div>
|
||||
<Stack gap={0.5}>
|
||||
<Text size="xs" variant="low" font="mono">• window.__GRIDPILOT_GLOBAL_HANDLER__</Text>
|
||||
<Text size="xs" variant="low" font="mono">• window.__GRIDPILOT_API_LOGGER__</Text>
|
||||
<Text size="xs" variant="low" font="mono">• window.__GRIDPILOT_REACT_ERRORS__</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
{/* Status */}
|
||||
<div style={{ paddingTop: '0.5rem', borderTop: '1px solid var(--ui-color-border-muted)', textAlign: 'center' }}>
|
||||
<Text size="xs" variant="low" style={{ fontSize: '10px' }}>
|
||||
<Stack align="center">
|
||||
<Text size="xs" variant="low">
|
||||
{debugEnabled ? 'Debug features active' : 'Debug mode disabled'}
|
||||
{isDev && ' • Development Environment'}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</DebugPanel>
|
||||
)}
|
||||
</React.Fragment>
|
||||
|
||||
Reference in New Issue
Block a user