Skip to content

Commit 89b3a93

Browse files
asizikovCopilot
andcommitted
fix: address PR review feedback
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 51b2fa5 commit 89b3a93

7 files changed

Lines changed: 26 additions & 25 deletions

File tree

src/App.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,18 @@
13201320

13211321
/* Responsive adjustments */
13221322
@media (max-width: 640px) {
1323+
.comparison-grid {
1324+
grid-template-columns: 1fr;
1325+
}
1326+
1327+
.next-steps__grid {
1328+
grid-template-columns: 1fr;
1329+
}
1330+
1331+
.next-steps__grid > .next-steps__card:last-child {
1332+
grid-column: auto;
1333+
}
1334+
13231335
.site-header {
13241336
padding: 12px 16px;
13251337
}

src/App.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@ import { CostCenterAggregator, type CostCenterResult } from './pipeline/aggregat
1515
import { OrganizationAggregator, type OrganizationResult } from './pipeline/aggregators/organizationAggregator'
1616
import { UserUsageAggregator, type UserUsageResult } from './pipeline/aggregators/userUsageAggregator'
1717
import { runPipeline } from './pipeline/runPipeline'
18+
import { formatUsd } from './utils/format'
1819

1920
type Status = 'idle' | 'processing' | 'done'
2021

2122
type DatedMetric = {
2223
date: string
2324
}
2425

25-
function formatUsd(n: number): string {
26-
return `$ ${n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
27-
}
28-
2926
function formatAiu(n: number): string {
3027
return n.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 3 })
3128
}
@@ -289,7 +286,7 @@ function App() {
289286
className={`sidebar__item ${activeView === 'overview' ? 'sidebar__item--active' : ''}`}
290287
onClick={() => setActiveView('overview')}
291288
>
292-
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
289+
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false">
293290
<rect x="3" y="3" width="7" height="7" rx="1" />
294291
<rect x="14" y="3" width="7" height="7" rx="1" />
295292
<rect x="3" y="14" width="7" height="7" rx="1" />
@@ -304,7 +301,7 @@ function App() {
304301
disabled={!userUsage}
305302
onClick={() => setActiveView('users')}
306303
>
307-
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
304+
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false">
308305
<circle cx="12" cy="8" r="4" />
309306
<path d="M20 21a8 8 0 1 0-16 0" />
310307
</svg>
@@ -317,7 +314,7 @@ function App() {
317314
className={`sidebar__item ${activeView === 'models' ? 'sidebar__item--active' : ''}`}
318315
onClick={() => setActiveView('models')}
319316
>
320-
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
317+
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false">
321318
<path d="M12 2L2 7l10 5 10-5-10-5Z" />
322319
<path d="M2 17l10 5 10-5" />
323320
<path d="M2 12l10 5 10-5" />
@@ -332,7 +329,7 @@ function App() {
332329
className={`sidebar__item ${activeView === 'orgs' ? 'sidebar__item--active' : ''}`}
333330
onClick={() => setActiveView('orgs')}
334331
>
335-
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
332+
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false">
336333
<rect x="4" y="3" width="16" height="18" rx="1" />
337334
<path d="M9 7h2M9 11h2M9 15h2M13 7h2M13 11h2M13 15h2" />
338335
</svg>
@@ -346,7 +343,7 @@ function App() {
346343
className={`sidebar__item ${activeView === 'costCenters' ? 'sidebar__item--active' : ''}`}
347344
onClick={() => setActiveView('costCenters')}
348345
>
349-
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
346+
<svg className="sidebar__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false">
350347
<path d="M12 3C8.5 3 6 5 6 7c0 2 2.5 4 6 4s6-2 6-4c0-2-2.5-4-6-4Z" />
351348
<path d="M6 7v4c0 2 2.5 4 6 4s6-2 6-4V7" />
352349
<path d="M6 11v4c0 2 2.5 4 6 4s6-2 6-4v-4" />

src/components/ui/BillingComparisonCard.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
function formatUsd(n: number): string {
2-
return `$ ${n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
3-
}
1+
import { formatUsd } from '../../utils/format'
42

53
export type BillingComparisonCardProps = {
64
title: string
@@ -55,7 +53,7 @@ export function BillingComparisonCard({
5553
</div>
5654
</div>
5755
<div className={`billing-comparison__verdict ${same ? 'billing-comparison__verdict--neutral' : aicCheaper ? 'billing-comparison__verdict--savings' : 'billing-comparison__verdict--overspend'}`}>
58-
<svg className="billing-comparison__verdict-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
56+
<svg className="billing-comparison__verdict-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false">
5957
{same ? (
6058
<><line x1="5" y1="12" x2="19" y2="12" /><line x1="12" y1="5" x2="12" y2="19" /></>
6159
) : aicCheaper ? (

src/utils/format.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function formatUsd(n: number): string {
2+
return `$ ${n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
3+
}

src/views/CostCentersView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { useMemo, useState } from 'react'
22
import type { CostCenterResult, CostTotals } from '../pipeline/aggregators/costCenterAggregator'
33
import { CostBreakdownCard } from '../components'
4-
5-
function formatUsd(n: number): string {
6-
return `$ ${n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
7-
}
4+
import { formatUsd } from '../utils/format'
85

96
function formatAiu(n: number): string {
107
return n.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 3 })

src/views/ModelsView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { useState, useMemo } from 'react'
22
import type { ModelUsageResult, ModelDailyUsageData } from '../pipeline/aggregators/modelUsageAggregator'
33
import { BillingComparisonCard, DualAxisLineChart } from '../components'
4-
5-
function formatUsd(n: number): string {
6-
return `$ ${n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
7-
}
4+
import { formatUsd } from '../utils/format'
85

96
function formatAiu(n: number): string {
107
return n.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 3 })

src/views/OrganizationsView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import type { OrganizationResult } from '../pipeline/aggregators/organizationAggregator'
2-
3-
function formatUsd(n: number): string {
4-
return `$ ${n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
5-
}
2+
import { formatUsd } from '../utils/format'
63

74
function formatAiu(n: number): string {
85
return n.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 3 })

0 commit comments

Comments
 (0)