mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 02:11:07 +05:30
style: run prettier formatter over src and tests
This commit is contained in:
@@ -12,29 +12,52 @@ export function CrashReportModal({ onClose }: { onClose: () => void }) {
|
||||
const [dumps, setDumps] = useState<Dump[]>([]);
|
||||
|
||||
const refresh = async () => setDumps(await ipc.crash.read());
|
||||
useEffect(() => { refresh(); }, []);
|
||||
useEffect(() => {
|
||||
refresh();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div role="dialog" aria-modal="true" data-testid="crash-report-modal" className="fixed inset-0 z-50 bg-black/40 flex items-center justify-center">
|
||||
<div
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
data-testid="crash-report-modal"
|
||||
className="fixed inset-0 z-50 bg-black/40 flex items-center justify-center"
|
||||
>
|
||||
<div className="bg-white dark:bg-neutral-900 rounded-lg p-6 w-[36rem] max-h-[80vh] overflow-y-auto shadow-xl">
|
||||
<header className="flex items-center justify-between mb-4">
|
||||
<h2 className="text-lg font-semibold">Crash reports</h2>
|
||||
<button onClick={onClose} aria-label="Close">×</button>
|
||||
<button onClick={onClose} aria-label="Close">
|
||||
×
|
||||
</button>
|
||||
</header>
|
||||
<button onClick={() => ipc.crash.openDir()} className="mb-4 px-3 py-1 text-sm border rounded">
|
||||
<button
|
||||
onClick={() => ipc.crash.openDir()}
|
||||
className="mb-4 px-3 py-1 text-sm border rounded"
|
||||
>
|
||||
Open dump folder
|
||||
</button>
|
||||
{dumps.length === 0 ? (
|
||||
<p data-testid="empty-state" className="text-neutral-500">No crashes recorded — nice work!</p>
|
||||
<p data-testid="empty-state" className="text-neutral-500">
|
||||
No crashes recorded — nice work!
|
||||
</p>
|
||||
) : (
|
||||
<ul className="space-y-2">
|
||||
{dumps.map((d) => (
|
||||
<li key={d.filename} className="border rounded p-2 text-sm flex justify-between items-start gap-2">
|
||||
<li
|
||||
key={d.filename}
|
||||
className="border rounded p-2 text-sm flex justify-between items-start gap-2"
|
||||
>
|
||||
<div>
|
||||
<div className="font-mono text-xs text-neutral-500">{d.timestamp}</div>
|
||||
<div>{d.message ?? '(no message)'}</div>
|
||||
</div>
|
||||
<button onClick={async () => { await ipc.crash.delete(d.filename); refresh(); }} className="text-red-600 text-xs">
|
||||
<button
|
||||
onClick={async () => {
|
||||
await ipc.crash.delete(d.filename);
|
||||
refresh();
|
||||
}}
|
||||
className="text-red-600 text-xs"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</li>
|
||||
@@ -44,4 +67,4 @@ export function CrashReportModal({ onClose }: { onClose: () => void }) {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user