import { useState } from 'react'; import { Button, Box, Paper, Typography } from '@mui/material'; import { Download, Upload } from '@mui/icons-material'; import { exportAllData, importDummyData } from '../services/storageService'; function DebugPanel() { const [dummyMode, setDummyMode] = useState(false); const handleExport = () => { const data = exportAllData(); const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `claudash-debug-${new Date().toISOString()}.json`; a.click(); URL.revokeObjectURL(url); }; const handleImport = (event) => { const file = event.target.files[0]; if (!file) return; const reader = new FileReader(); reader.onload = (e) => { try { const data = JSON.parse(e.target.result); importDummyData(data); setDummyMode(true); window.location.reload(); } catch (error) { console.error('Error importing data:', error); alert('Failed to import data. Please check the file format.'); } }; reader.readAsText(file); }; return ( Debug Tools {dummyMode && ( Using dummy data )} ); } export default DebugPanel;