From 88bf4c4450269b95242e0f91547655e8846b4e4c Mon Sep 17 00:00:00 2001 From: Nicolaj Hartmann Date: Fri, 30 Jan 2026 22:24:36 +0100 Subject: [PATCH] Fix whitescreen - add missing types, exports and props Frontend build fixes: - Add formatDateTimeISO and parseISODate to formatters.ts - Add default type parameter to fetchGraphQL function - Add toggleMobileDrawer and mobileDrawerOpen to uiStore - Add compact prop to CompanySwitcher component - Add JournalEntryDraft types to accounting.ts - Add reopened/locked fields to FiscalYear type - Fix documentProcessing.ts import Closes books-0rs Co-Authored-By: Claude Opus 4.5 --- frontend/src/api/client.ts | 2 +- .../src/components/layout/CompanySwitcher.tsx | 8 ++- frontend/src/lib/formatters.ts | 16 +++++ frontend/src/lib/periods.ts | 2 +- frontend/src/stores/uiStore.ts | 12 ++++ frontend/src/types/accounting.ts | 62 +++++++++++++++++++ frontend/src/types/periods.ts | 8 +++ frontend/tsconfig.tsbuildinfo | 2 +- 8 files changed, 107 insertions(+), 5 deletions(-) diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index 2efc594..29c373a 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -33,7 +33,7 @@ export const queryClient = new QueryClient({ }); // Helper function to make GraphQL requests with error handling -export async function fetchGraphQL>( +export async function fetchGraphQL = Record>( query: string, variables?: TVariables ): Promise { diff --git a/frontend/src/components/layout/CompanySwitcher.tsx b/frontend/src/components/layout/CompanySwitcher.tsx index faa6db7..86ec65e 100644 --- a/frontend/src/components/layout/CompanySwitcher.tsx +++ b/frontend/src/components/layout/CompanySwitcher.tsx @@ -6,6 +6,10 @@ import type { Company } from '@/types/accounting'; const { Text } = Typography; +interface CompanySwitcherProps { + compact?: boolean; +} + // Mock data - will be replaced with API call const mockCompanies: Company[] = [ { @@ -36,7 +40,7 @@ const mockCompanies: Company[] = [ }, ]; -export default function CompanySwitcher() { +export default function CompanySwitcher({ compact = false }: CompanySwitcherProps) { const { activeCompany, setActiveCompany, setCompanies } = useCompanyStore(); // Initialize with mock data if needed @@ -62,7 +66,7 @@ export default function CompanySwitcher() {