Skip to content

Commit 5c4c272

Browse files
committed
feat(frontend): colorize summary and copy state
1 parent ad57a49 commit 5c4c272

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

apps/frontend/src/app/globals.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,14 @@ body {
367367
font-weight: 700;
368368
}
369369

370+
.summary-value--error {
371+
color: #d94848;
372+
}
373+
374+
.summary-value--warning {
375+
color: #f4b840;
376+
}
377+
370378
.finding-list {
371379
list-style: none;
372380
padding: 0;

apps/frontend/src/app/page.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default function Home() {
99
const [result, setResult] = useState<Record<string, unknown> | null>(null);
1010
const [rawResult, setRawResult] = useState<string | null>(null);
1111
const [isUploading, setIsUploading] = useState(false);
12+
const [copied, setCopied] = useState(false);
1213

1314
const examplePayload = {
1415
report: {
@@ -295,11 +296,15 @@ export default function Home() {
295296
<div className="report-summary">
296297
<div>
297298
<div className="summary-label">Errors</div>
298-
<div className="summary-value">{summary.errorCount}</div>
299+
<div className="summary-value summary-value--error">
300+
{summary.errorCount}
301+
</div>
299302
</div>
300303
<div>
301304
<div className="summary-label">Warnings</div>
302-
<div className="summary-value">{summary.warningCount}</div>
305+
<div className="summary-value summary-value--warning">
306+
{summary.warningCount}
307+
</div>
303308
</div>
304309
<div>
305310
<div className="summary-label">Findings</div>
@@ -381,10 +386,12 @@ export default function Home() {
381386
onClick={() => {
382387
if (!rawResult) return;
383388
void navigator.clipboard?.writeText(rawResult);
384-
setStatus("Report copied to clipboard");
389+
setCopied(true);
390+
setStatus("Copied JSON to clipboard");
391+
window.setTimeout(() => setCopied(false), 1500);
385392
}}
386393
>
387-
Copy JSON
394+
{copied ? "✓ Copied" : "📋 Copy JSON"}
388395
</button>
389396
</div>
390397
</div>

0 commit comments

Comments
 (0)