Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/dashboard-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function buildDailySpendData(breakdown: SpendBreakdownRow[]): {
const point = byDate.get(row.date) as Record<string, number>;
const firstName = row.name.split(" ")[0] ?? row.name;
const dollars = row.spend_cents / 100;
point.total += dollars;
point.total = (point.total ?? 0) + dollars;
if (topNames.includes(firstName)) {
point[firstName] = (point[firstName] as number) + dollars;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/app/insights/insights-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function InsightsClient({ data }: { data: InsightsData }) {
if (!byDate.has(entry.date)) byDate.set(entry.date, { _total: 0 });
const row = byDate.get(entry.date) as Record<string, number>;
row[model] = (row[model] ?? 0) + entry.messages;
row._total += entry.messages;
row._total = (row._total ?? 0) + entry.messages;
}
const result: Array<Record<string, string | number>> = [];
for (const [date, row] of [...byDate.entries()].sort((a, b) => a[0].localeCompare(b[0]))) {
Expand Down Expand Up @@ -658,7 +658,7 @@ function ModelEfficiencySection({ data }: { data: ModelEfficiencyEntry[] }) {
<LabelList
dataKey="precision_pct"
position="right"
formatter={(v: number) => `${v}%`}
formatter={(v) => `${v ?? ""}%`}
style={{ fontSize: 10, fill: "#a1a1aa", fontFamily: "monospace" }}
/>
</Bar>
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/members-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function rankBadge(rank: number) {
return `#${rank}`;
}

function SortIcon({ active, asc }: { active: boolean; asc: boolean }) {
function SortIcon({ active, asc }: { col?: string; active: boolean; asc: boolean }) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The col prop is added to fix a TypeScript error, but it's not used within the SortIcon component. To improve code clarity and remove unused code, it would be better to remove the col prop from the component's call sites (lines 66, 74, 81, 88, 95) and then remove it from the type definition here.

Suggested change
function SortIcon({ active, asc }: { col?: string; active: boolean; asc: boolean }) {
function SortIcon({ active, asc }: { active: boolean; asc: boolean }) {

if (!active) return <span className="text-zinc-700 ml-0.5">↕</span>;
return <span className="text-blue-400 ml-0.5">{asc ? "↑" : "↓"}</span>;
}
Expand Down
Loading