fix(vendor): pass bsrData prop to VendorDataView - resolves black screen

VendorDataView was refactored to receive BSR data as a prop but App.tsx
was not updated to pass it, causing the component to crash on undefined
and show a blank screen. Also fixes supabase.ts type errors and removes
dead code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
christian.vidal
2026-03-02 18:32:38 +01:00
co-authored by Claude Sonnet 4.6
parent 243c44c7f7
commit ce13d17eda
2 changed files with 9 additions and 14 deletions
+1 -1
View File
@@ -959,7 +959,7 @@ const App: React.FC = () => {
<Suspense fallback={<LoadingSpinner />}>
<div className={view === 'vendor' ? '' : 'hidden'}>
<VendorDataView />
<VendorDataView bsrData={bsrData} />
</div>
</Suspense>
+8 -13
View File
@@ -1,4 +1,4 @@
/// <reference types="node" />
import { createClient, SupabaseClient } from '@supabase/supabase-js';
import { VendorDailyRow } from '../types';
@@ -20,7 +20,11 @@ const getClient = (): SupabaseClient => {
autoRefreshToken: false,
persistSession: false,
detectSessionInUrl: false,
storage: false as any
storage: {
getItem: (_key: string) => null,
setItem: (_key: string, _value: string) => {},
removeItem: (_key: string) => {},
},
}
});
}
@@ -66,15 +70,6 @@ export const fetchVendorData = async (filters: VendorFilters): Promise<VendorDai
query = query.lte('date', filters.dateTo);
}
if (filters.years?.length) {
// Filter by year using date range
const yearFilters = filters.years.map(y => ({
from: `${y}-01-01`,
to: `${y}-12-31`
}));
const dateConditions = yearFilters.flatMap(f => [
`date.gte.${f.from}`,
`date.lte.${f.to}`
]);
// Build OR condition for multiple years
query = query.or(
filters.years.map(y => `and(date.gte.${y}-01-01,date.lte.${y}-12-31)`).join(',')
@@ -124,8 +119,8 @@ export const fetchVendorFilterOptions = async (): Promise<{
.order('date', { ascending: false })
.limit(1);
const markets = [...new Set((marketData || []).map((r: any) => r.market as string))].sort();
const tags = [...new Set((tagData || []).map((r: any) => r.tags as string).filter(Boolean))].sort();
const markets = Array.from(new Set<string>((marketData || []).map((r: any) => r.market as string))).sort();
const tags = Array.from(new Set<string>((tagData || []).map((r: any) => r.tags as string).filter(Boolean))).sort();
return {
markets,