Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Nov 17, 2025

  • Add null coalescing operators to total_events and total_hackathons to prevent undefined display
  • Replace total_participants with total_registrations for accurate metric tracking
  • Update label from "Participants" to "Registrations" for clarity
  • Add total_registrations field to Company interface type definition
  • Ensure all statistics display 0 as fallback when data is unavailable

Authored by: @akshay0611

Summary by CodeRabbit

  • Bug Fixes

    • Company profile statistics now display 0 instead of undefined values when data is unavailable.
  • Improvements

    • Updated statistics label from "Participants" to "Registrations" for consistency with data structure.

…s display

- Add null coalescing operators to total_events and total_hackathons to prevent undefined display
- Replace total_participants with total_registrations for accurate metric tracking
- Update label from "Participants" to "Registrations" for clarity
- Add total_registrations field to Company interface type definition
- Ensure all statistics display 0 as fallback when data is unavailable
@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codeunia Building Building Preview Comment Nov 17, 2025 7:51am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

A new total_registrations field was added to the Company type definition, and the CompanyProfile component was updated to display registration statistics in place of participants with null-coalescing defaults applied to numeric fields.

Changes

Cohort / File(s) Summary
Type Definition Update
types/company.ts
Added new numeric field total_registrations to the Company interface.
Component UI Update
components/companies/CompanyProfile.tsx
Updated statistics grid to use total_registrations instead of total_participants, changed label from "Participants" to "Registrations", and added null-coalescing defaults (|| 0) to all numeric stat values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • The changes are localized to a single interface addition and one component update
  • Null-coalescing pattern applied consistently across three numeric fields
  • Straightforward field rename with clear semantic intent

Possibly related PRs

  • #320: Implements analytics logic to increment the company.total_registrations field that this PR introduces into the type system and UI.

Poem

🐰 A registration field hops into view,
No more guessing what participants do!
Nulls now default to zero with care,
The stats are complete, the dashboard so fair! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/companydashboard

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24ff47c and f4db0b9.

📒 Files selected for processing (2)
  • components/companies/CompanyProfile.tsx (1 hunks)
  • types/company.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants