diff --git a/apps/console/src/app/(console)/dashboard/page.tsx b/apps/console/src/app/(console)/dashboard/page.tsx index 174e3f92..daeafed5 100644 --- a/apps/console/src/app/(console)/dashboard/page.tsx +++ b/apps/console/src/app/(console)/dashboard/page.tsx @@ -10,7 +10,8 @@ function TrendChart({ values, labels }: { values: number[]; labels?: string[] }) return
; } - const max = Math.max(...values, 1); + // ⚡ Bolt: Avoid spread operator overhead which can cause call stack issues with large arrays. + const max = values.reduce((m, v) => (v > m ? v : m), 1); const linePoints = values .map((value, index) => { const x = (index / Math.max(values.length - 1, 1)) * 100; @@ -44,7 +45,8 @@ function TrendChart({ values, labels }: { values: number[]; labels?: string[] }) } function MeterList({ items }: { items: Array<{ label: string; value: number; hint?: string }> }) { - const max = Math.max(...items.map((i) => i.value), 1); + // ⚡ Bolt: Avoid O(N) intermediate array allocation and spread operator overhead by using a single reduce pass. + const max = items.reduce((currentMax, item) => (item.value > currentMax ? item.value : currentMax), 1); return (
{items.map((item) => ( diff --git a/apps/console/src/components/console/charts.tsx b/apps/console/src/components/console/charts.tsx index c7503339..da17cb96 100644 --- a/apps/console/src/components/console/charts.tsx +++ b/apps/console/src/components/console/charts.tsx @@ -9,7 +9,8 @@ export function MiniBarChart({ values: number[]; className?: string; }) { - const max = Math.max(...values, 1); + // ⚡ Bolt: Avoid spread operator overhead which can cause call stack issues with large arrays. + const max = values.reduce((m, v) => (v > m ? v : m), 1); return (
@@ -36,7 +37,8 @@ export function LinePulse({ return
; } - const max = Math.max(...values, 1); + // ⚡ Bolt: Avoid spread operator overhead which can cause call stack issues with large arrays. + const max = values.reduce((m, v) => (v > m ? v : m), 1); const points = values .map((value, index) => { const x = (index / Math.max(values.length - 1, 1)) * 100; @@ -79,7 +81,8 @@ export function TrendAreaChart({ return
; } - const max = Math.max(...values, 1); + // ⚡ Bolt: Avoid spread operator overhead which can cause call stack issues with large arrays. + const max = values.reduce((m, v) => (v > m ? v : m), 1); const linePoints = values .map((value, index) => { const x = (index / Math.max(values.length - 1, 1)) * 100; diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx index 30dbfe55..39892cfb 100644 --- a/apps/web/src/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -179,7 +179,7 @@ export default function LandingPage() {
{/* Code body */}
-
// One endpoint — any model
+
{"// One endpoint — any model"}
const res = await fetch(
@@ -215,12 +215,12 @@ export default function LandingPage() { {/* Response */}
-
// ↳ Auto-routed to cheapest provider
+
{"// ↳ Auto-routed to cheapest provider"}
- model: "gpt-4o" // via OpenAI + model: "gpt-4o" {"// via OpenAI"}
- tokens: 42 // 1 credit deducted + tokens: 42 {"// 1 credit deducted"}
latency: 842ms diff --git a/apps/web/src/app/terms/page.tsx b/apps/web/src/app/terms/page.tsx index c2d9142e..fd13d4b6 100644 --- a/apps/web/src/app/terms/page.tsx +++ b/apps/web/src/app/terms/page.tsx @@ -36,7 +36,7 @@ export default function TermsPage() {

5. Limitation of Liability

-

AI Gateway is provided "as is" without warranties of any kind. We are not liable for indirect, incidental, or consequential damages arising from service use.

+

AI Gateway is provided "as is" without warranties of any kind. We are not liable for indirect, incidental, or consequential damages arising from service use.

6. Contact