Skip to content

Commit 2669e95

Browse files
jonradoffclaude
andcommitted
Fix TypeScript errors in PMPage and AnnouncementsPage
Recharts Tooltip formatter parameter can be undefined, and Zod schema optional() caused type mismatch with react-hook-form resolver. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8d2054b commit 2669e95

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

frontend/src/pages/admin/AnnouncementsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export default function AnnouncementsPage() {
150150

151151
const announcementSchema = z.object({
152152
title: z.string().trim().min(1, 'Title is required'),
153-
body: z.string().trim().optional().default(''),
153+
body: z.string().trim().default(''),
154154
publish: z.boolean().default(false),
155155
});
156156

frontend/src/pages/admin/PMPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function KPIsTab() {
176176
</defs>
177177
<XAxis dataKey="date" tick={{ fontSize: 10, fill: '#64748b' }} tickLine={false} axisLine={false} />
178178
<YAxis hide />
179-
<Tooltip contentStyle={tooltipStyle} labelStyle={tooltipLabelStyle} formatter={(v: number) => [formatCents(v), 'MRR']} />
179+
<Tooltip contentStyle={tooltipStyle} labelStyle={tooltipLabelStyle} formatter={(v) => [formatCents(v as number), 'MRR']} />
180180
<Area type="monotone" dataKey="value" stroke="#10b981" fill="url(#mrrGrad)" strokeWidth={2} />
181181
</AreaChart>
182182
</ResponsiveContainer>
@@ -363,7 +363,7 @@ function EngagementTab() {
363363
</defs>
364364
<XAxis dataKey="date" tick={{ fontSize: 10, fill: '#64748b' }} tickLine={false} axisLine={false} />
365365
<YAxis hide />
366-
<Tooltip contentStyle={tooltipStyle} labelStyle={tooltipLabelStyle} formatter={(v: number) => [formatNum(v), 'Credits']} />
366+
<Tooltip contentStyle={tooltipStyle} labelStyle={tooltipLabelStyle} formatter={(v) => [formatNum(v as number), 'Credits']} />
367367
<Area type="monotone" dataKey="value" stroke="#8b5cf6" fill="url(#creditGrad)" strokeWidth={2} />
368368
</AreaChart>
369369
</ResponsiveContainer>
@@ -442,7 +442,7 @@ function EventsTab() {
442442
</defs>
443443
<XAxis dataKey="date" tick={{ fontSize: 10, fill: '#64748b' }} tickLine={false} axisLine={false} />
444444
<YAxis hide />
445-
<Tooltip contentStyle={tooltipStyle} labelStyle={tooltipLabelStyle} formatter={(v: number) => [formatNum(v), 'Events']} />
445+
<Tooltip contentStyle={tooltipStyle} labelStyle={tooltipLabelStyle} formatter={(v) => [formatNum(v as number), 'Events']} />
446446
<Area type="monotone" dataKey="value" stroke="#10b981" fill="url(#eventGrad)" strokeWidth={2} />
447447
</AreaChart>
448448
</ResponsiveContainer>

0 commit comments

Comments
 (0)