Spaces:
Sleeping
Sleeping
adityaverma977 commited on
Commit ·
71640b5
1
Parent(s): 3890926
Fix TypeScript type error in page.tsx - add type assertion after filter
Browse files23 unmodified lines24252627282930313233343536373823 unmodified linesconst state = h.state || hconst a = (state.agents || []).find((x: any) => x.model_name === m.id)return a ? { x: a.x, y: a.y, water: a.water_collected, status: a.status, extinguish_score: a.extinguish_score || 0, last_message: a.last_message } : null}).filter(Boolean)let distance = 0for (let i = 1; i < positions.length; i++) {const p0 = positions[i-1]const p1 = positions[i]const dx = p1.x - p0.xconst dy = p1.y - p0.ydistance += Math.sqrt(dx*dx + dy*dy)}let water_picks = 023 unmodified lines242526272829303132333435363738394023 unmodified linesconst state = h.state || hconst a = (state.agents || []).find((x: any) => x.model_name === m.id)return a ? { x: a.x, y: a.y, water: a.water_collected, status: a.status, extinguish_score: a.extinguish_score || 0, last_message: a.last_message } : null}).filter(Boolean) as Array<{ x: number, y: number, water: number, status: string, extinguish_score: number, last_message: string }>let distance = 0for (let i = 1; i < positions.length; i++) {const p0 = positions[i-1]const p1 = positions[i]if (p0 && p1) {const dx = p1.x - p0.xconst dy = p1.y - p0.ydistance += Math.sqrt(dx*dx + dy*dy)}}let water_picks = 0
frontend/app/page.tsx+6-4