/* Dashboard — split into A) Authority Status & Records and B) Construction Progress */ (function () { const Icon = window.Icon, Donut = window.Donut, StatusBadge = window.StatusBadge; const D = window.YEIDA, fmt = D.fmtINR; function SectionLabel({ n, title, sub, children }) { return (
Module {n}

{title}

{sub &&
{sub}
}
{children}
); } function StatusCard({ icon, title, code, date, color }) { const s = D.STATUS_CODES[code] || {}; const tone = s.tone || 'gray'; const tc = { green: ['var(--emerald-50)', 'var(--emerald-700)', 'var(--emerald-500)'], amber: ['var(--amber-50)', 'var(--amber-600)', 'var(--amber-500)'], blue: ['var(--blue-50)', 'var(--blue-600)', 'var(--blue-500)'], gray: ['var(--bg-2)', 'var(--muted)', '#c2cedd'] }[tone]; return (
{tone === 'green' ? : tone === 'amber' ? : }
{title}
{s.label}
{date}
); } function Dashboard({ go }) { const [view, setView] = React.useState(() => localStorage.getItem('yeida_dash') || 'plot'); const A = D.authorityStatus; const switchTo = (v) => { setView(v); localStorage.setItem('yeida_dash', v); }; return (
{/* Welcome banner */}
{/* decorative concentric rings */}
Official Allottee Portal

Welcome back, {D.user.firstName}

Plot {D.user.plot} · {D.user.sector} {D.user.relationship} · {D.user.isAllottee ? 'Allottee' : 'Representative'} {A.leaseDeed.label} {A.atl.label}
{/* ===== Module switcher: Plot Dashboard (primary) · Construction Project Dashboard (secondary) ===== */}
{[ { k: 'plot', icon: 'building', title: 'Yamuna Expressway · Plot Dashboard', sub: 'Authority status, records & payments', tag: 'Primary' }, { k: 'construction', icon: 'construction', title: 'Construction Project Dashboard', sub: 'Build progress, milestones & contractor', tag: D.journey.constructionStarted ? 'Active' : 'Not started' }, ].map(m => { const on = view === m.k; return ( ); })}
{view === 'plot' ? : }
); } /* ============================ MODULE 1 — PLOT DASHBOARD (PRIMARY) ============================ */ function PlotDashboard({ go }) { const totalDue = D.dues.reduce((s, d) => s + d.amount, 0); const paidPct = Math.round(D.property.paid / D.property.totalValue * 100); const A = D.authorityStatus; return (
{/* Pending actions strip */}
3 pending actions need your attention
ATL pending · 1 overdue payment · Soil Test Report awaited
{/* Authority Status — key metrics */} {(() => { const last = D.authorityRecords[D.authorityRecords.length - 1] || D.authorityRecords[0]; const nextDue = [...D.dues].sort((a, b) => a.due.localeCompare(b.due))[0] || D.dues[0]; const metrics = [ { label: 'Total Paid', value: fmt(D.property.paid), sub: D.authorityRecords.length + ' receipts', icon: 'checkCircle', color: 'emerald' }, { label: 'Outstanding Dues', value: fmt(totalDue), sub: D.dues.length + ' pending', icon: 'rupee', color: 'amber' }, { label: 'Last Payment', value: fmt(last.amount), sub: last.date, icon: 'history', color: 'blue' }, { label: 'Next Due', value: nextDue.due, sub: fmt(nextDue.amount) + ' · ' + nextDue.type, icon: 'calendar', color: 'navy' }, ]; const C = { emerald: ['var(--emerald-50)', 'var(--emerald-700)'], amber: ['var(--amber-50)', 'var(--amber-600)'], blue: ['var(--blue-50)', 'var(--blue-600)'], navy: ['#e9eefb', 'var(--navy-700)'] }; return (
{metrics.map(m => { const cc = C[m.color]; return (
{m.label}
{m.value}
{m.sub}
); })}
); })()}
{/* Authority payments summary */}
Authority Payments

Premium & lease account

Total Premium
{fmt(D.property.totalValue)}
Deposited
{fmt(D.property.paid)}
Balance
{fmt(D.property.totalValue - D.property.paid)}
{paidPct}% of premium deposited{D.authorityRecords.length} official receipts
{/* Pending dues + due dates */}

Pending Dues & Due Dates

{D.dues.length} pending
{D.dues.map(d => (
{d.label}
{d.status === 'overdue' ? 'Overdue' : d.status === 'due' ? 'Due soon' : 'Upcoming'} {d.due}
{fmt(d.amount)}
))}
{/* Official records table */}

Official Authority Records

Verified deposits & challans on record with YEIDA

{D.authorityRecords.map(r => ( ))}
Head of AccountChallan No.DateModeStatusAmount
{r.head} {r.challan} {r.date} {r.mode} {r.status} {fmt(r.amount)}
{/* Latest Notices · AI Assistant · Recent Documents */}

Latest Notices

{D.notices.slice(0, 3).map(n => ( ))}

AI Assistant

Online · ask anything
{['What payments are pending?', 'What is my ATL status?'].map(q => ( ))}

Recent Documents

{D.documents.slice(0, 4).map((d, i) => ( ))}
); } /* ============================ MODULE 2 — CONSTRUCTION PROJECT DASHBOARD (SECONDARY) ============================ */ function ConstructionDashboard({ go }) { const J = D.journey; return (
{/* construction financial / site widgets */}
{Math.round(D.construction.spent / D.construction.estimatedCost * 100)}% spent
Estimated Build Cost
{fmt(D.construction.estimatedCost)}
{fmt(D.construction.spent)} spent to date
{D.construction.contractor.status}
Contractor Status
{D.construction.contractor.name}
{D.construction.contractor.rating} Engaged since {D.construction.contractor.since}
{D.construction.onSchedule ? 'On schedule' : 'Delayed'}
Completion Forecast
{D.construction.completionForecast}
Current: {D.construction.currentMilestone}
{/* status + progress */}
{J.constructionStarted ? 'Construction Started' : 'Not Started'}
Current Stage
{J.stage}
Next Required Action
{J.nextAction}
{/* milestones */}

Milestones

{D.constructionMilestones.map((m, i) => (
{m.label} 0 ? 'blue' : 'gray')} style={{ fontSize: 10.5 }}>{m.status}
{m.date}
))}
{/* timeline */}

Activity Timeline

{D.activity.slice(0, 4).map((a, i, arr) => { const cc = { emerald: 'var(--emerald-500)', blue: 'var(--blue-500)', amber: 'var(--amber-500)', navy: 'var(--navy-700)' }[a.color]; return (
{i !== arr.length - 1 && }
{a.title}
{a.desc}
{a.time}
); })}
{/* construction payments shortcut + sample plans CTA */}
Construction Payments
Milestone invoices & receipts
Sample Plans & Tours
Designs matched to your plot
); } window.Dashboard = Dashboard; })();