From 161a5aa85ec1878ba8988577d9443c099423e371 Mon Sep 17 00:00:00 2001 From: Robert van Diest Date: Thu, 30 Apr 2026 16:51:01 +0200 Subject: [PATCH] fix(frontend): remove unused variables causing tsc build failure Remove unused `auth` prop from AdminPage (and its call site in App.tsx) and unused `maxDate` variable in PlannerPage. Both triggered TS6133 under noUnusedLocals, causing `npm run build` to exit with code 2 in Docker. --- src/frontend/src/App.tsx | 2 +- src/frontend/src/pages/AdminPage.tsx | 5 ++--- src/frontend/src/pages/PlannerPage.tsx | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index 1cbe74b..db732fe 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -40,7 +40,7 @@ export default function App() { } /> : } + element={auth.isAdmin ? : } /> } /> diff --git a/src/frontend/src/pages/AdminPage.tsx b/src/frontend/src/pages/AdminPage.tsx index ae3fce1..07661b0 100644 --- a/src/frontend/src/pages/AdminPage.tsx +++ b/src/frontend/src/pages/AdminPage.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { api } from '../api/client'; -import type { AdminUser, AuthResponse } from '../api/types'; +import type { AdminUser } from '../api/types'; const PURPLE = '#5b4fc7'; const PURPLE_DEEP = '#3f33a8'; @@ -10,7 +10,6 @@ const SAGE_DEEP = '#a9bb96'; const PAPER = '#f4f3ee'; interface AdminPageProps { - auth: AuthResponse; onLogout: () => void; } @@ -18,7 +17,7 @@ function monogram(name: string): string { return name.split(' ').map((n) => n[0]).join('').slice(0, 2).toUpperCase(); } -export function AdminPage({ auth, onLogout }: AdminPageProps) { +export function AdminPage({ onLogout }: AdminPageProps) { const navigate = useNavigate(); const [users, setUsers] = useState([]); const [loading, setLoading] = useState(true); diff --git a/src/frontend/src/pages/PlannerPage.tsx b/src/frontend/src/pages/PlannerPage.tsx index 036f77b..c24a7a0 100644 --- a/src/frontend/src/pages/PlannerPage.tsx +++ b/src/frontend/src/pages/PlannerPage.tsx @@ -84,7 +84,6 @@ export function PlannerPage({ auth, onLogout }: PlannerPageProps) { const today = toIsoDate(new Date()); const MAX_OFFSET = 13; - const maxDate = offsetDate(today, MAX_OFFSET); const [selectedDate, setSelectedDate] = useState(today); const [schedule, setSchedule] = useState([]);