@@ -43,15 +43,10 @@ export default function ContributorsPage() {
4343 document . removeEventListener ( 'mousedown' , handleClickOutside )
4444 } , [ ] )
4545
46- if ( ! model ) return null
47- const { contributors } = model
4846 const navigate = useNavigate ( )
47+ const contributors = model ?. contributors ?? [ ]
4948
5049 const busFactor = useMemo ( ( ) => computeBusFactor ( contributors ) , [ contributors ] )
51- const topActive = contributors . slice ( 0 , 10 ) . filter ( c => c . freshness > 50 ) . length
52- const freshPct = contributors . length ? Math . round ( topActive / Math . min ( 10 , contributors . length ) * 100 ) : 0
53- const connectors = contributors . filter ( c => c . isConnector )
54- const crossOrg = contributors . filter ( c => c . isCrossOrg )
5550
5651 const filtered = useMemo ( ( ) =>
5752 contributors . filter ( c => ! search || c . login . toLowerCase ( ) . includes ( search . toLowerCase ( ) ) ) ,
@@ -60,6 +55,13 @@ export default function ContributorsPage() {
6055 const { sorted, sortConfig, onSort } = useSortedData ( filtered , 'totalContribs' , 'desc' )
6156 const visible = sorted . slice ( 0 , shown )
6257
58+ if ( ! model ) return null
59+
60+ const topActive = contributors . slice ( 0 , 10 ) . filter ( c => c . freshness > 50 ) . length
61+ const freshPct = contributors . length ? Math . round ( topActive / Math . min ( 10 , contributors . length ) * 100 ) : 0
62+ const connectors = contributors . filter ( c => c . isConnector )
63+ const crossOrg = contributors . filter ( c => c . isCrossOrg )
64+
6365 const riskColor = r => r === 'critical' ? 'var(--red)' : r === 'high' ? 'var(--amber)' : 'var(--green)'
6466 const riskBar = r => r === 'critical' ? '90%' : r === 'high' ? '60%' : '25%'
6567
0 commit comments