Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds a College Distribution section to the admin dashboard with hardcoded college registration counts. The PR also includes a new QR code image file for SRKR college payments.
Changes:
- Added a new "College Distribution" section displaying participant counts for six colleges
- Included hardcoded data showing 145 participants from Shri Vishnu Engineering College for Women, 102 from SRKR Engineering College, and smaller numbers from other institutions
- Added public/srkr-qr.webp image file (referenced in existing payment form)
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/admin/Dashboard.tsx | Adds College Distribution section with hardcoded college names and participant counts; includes extra blank lines |
| public/srkr-qr.webp | New QR code image file for SRKR college payment processing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {Object.entries({ | ||
| "Shri Vishnu Engineering College for Women": 145, | ||
| "Vishnu Institute of Technology": 1, | ||
| "Swarnandhra College of Engineering and Technology": 2, | ||
| "SRKR Engineering College": 102, | ||
| "Sasi Institute of Technology": 1, | ||
| "Adithya Engineering College": 4, | ||
| }).map(([college, count]) => ( |
There was a problem hiding this comment.
Hardcoded college distribution data will become stale and inaccurate as new participants register. Similar to branchDistribution and yearDistribution which are fetched dynamically from the stats API, the college distribution should also be retrieved from the backend. Consider adding a collegeDistribution field to the DashboardStats interface in src/api/admin.ts and fetching this data from the /admin/dashboard/stats endpoint.
| {Object.entries({ | |
| "Shri Vishnu Engineering College for Women": 145, | |
| "Vishnu Institute of Technology": 1, | |
| "Swarnandhra College of Engineering and Technology": 2, | |
| "SRKR Engineering College": 102, | |
| "Sasi Institute of Technology": 1, | |
| "Adithya Engineering College": 4, | |
| }).map(([college, count]) => ( | |
| {Object.entries(stats?.collegeDistribution ?? {}).map(([college, count]) => ( |
| <div className="mb-8"> | ||
| <h2 className="text-xl font-semibold mb-4">College Distribution</h2> | ||
|
|
||
| <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4"> | ||
| {Object.entries({ | ||
| "Shri Vishnu Engineering College for Women": 145, | ||
| "Vishnu Institute of Technology": 1, | ||
| "Swarnandhra College of Engineering and Technology": 2, | ||
| "SRKR Engineering College": 102, | ||
| "Sasi Institute of Technology": 1, | ||
| "Adithya Engineering College": 4, | ||
| }).map(([college, count]) => ( | ||
| <div | ||
| key={college} | ||
| className="bg-pink-100 rounded-lg p-4 flex flex-col items-center shadow hover:scale-105 transition" | ||
| > | ||
| <span className="text-sm text-pink-600 text-center font-medium"> | ||
| {college} | ||
| </span> | ||
| <span className="text-2xl font-bold text-pink-700 mt-2"> | ||
| {count} | ||
| </span> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> |
There was a problem hiding this comment.
The College Distribution section is not using data from the stats object that's fetched from the API. This means the data shown will be static and won't reflect the actual current state of registrations. Like the Branch Distribution section below it (lines 104-118), this should map over dynamic data from the stats object.
|
|
||
|
|
There was a problem hiding this comment.
Extra blank lines added without purpose. Consider removing these unnecessary blank lines to maintain code cleanliness.
Pull Request Template
Description
Please include a summary of the change and which issue is fixed.
Type of change
Checklist