Skip to content

Commit 86d0246

Browse files
committed
style: lint
1 parent f2eefc3 commit 86d0246

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

web/src/components/results/jar-result.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { GenerateResult } from "@/types/shell";
33
import { useTranslation } from "react-i18next";
44
import { Button } from "../ui/button";
55

6-
export function JarResult({ packResult, generateResult }: Readonly<{ packResult: string; generateResult?: GenerateResult }>) {
6+
export function JarResult({
7+
packResult,
8+
generateResult,
9+
}: Readonly<{ packResult: string; generateResult?: GenerateResult }>) {
710
const { t } = useTranslation();
811
return (
912
<div className="flex items-center justify-center">

web/src/components/results/result-component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { GenerateResult } from "@/types/shell";
22
import { TFunction } from "i18next";
3-
import { Fragment } from "react/jsx-runtime";
43
import { CodeViewer } from "../code-viewer";
54
import { AgentResult } from "./agent";
65
import { JarResult } from "./jar-result";

web/src/lib/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ export function downloadBytes(base64String: string, className?: string, jarName?
2727
}
2828

2929
export function formatBytes(bytes: number) {
30-
if (bytes === 0) return '0 Bytes';
31-
if (Number.isNaN(bytes) || !Number.isFinite(bytes)) return 'N/A';
30+
if (bytes === 0) return "0 Bytes";
31+
if (Number.isNaN(bytes) || !Number.isFinite(bytes)) return "N/A";
3232

3333
const k = 1024;
34-
const sizes = ['Bytes', 'KB', 'MB']; // Add more units like GB, TB if needed
34+
const sizes = ["Bytes", "KB", "MB"]; // Add more units like GB, TB if needed
3535

3636
if (bytes < k) {
3737
return `${bytes.toFixed(0)} ${sizes[0]}`; // Bytes, no decimal
@@ -40,10 +40,10 @@ export function formatBytes(bytes: number) {
4040
const i = Math.floor(Math.log(bytes) / Math.log(k));
4141

4242
// Prefer MB if KB value is 1000 or more, or if it's already in MB (i >= 2)
43-
if (i >= 2 || (bytes / k ** 1) >= 1000) {
43+
if (i >= 2 || bytes / k ** 1 >= 1000) {
4444
const mbValue = Number.parseFloat((bytes / k ** 2).toFixed(2));
4545
return `${mbValue} ${sizes[2]}`;
4646
}
4747
const kbValue = Number.parseFloat((bytes / k ** 1).toFixed(1));
4848
return `${kbValue} ${sizes[1]}`;
49-
}
49+
}

0 commit comments

Comments
 (0)