Skip to content

Conversation

@WynonnaSun
Copy link
Contributor

@WynonnaSun WynonnaSun commented Dec 8, 2025

Change Summary

This PR is for HeaderCard UI component used in the admin dashboard.
The component supports 4 variants. Each of them includes a left accent bar, value display, label, and icon

Change Form

  • [ ✅ ] The pull request title has an issue number
  • [ ✅ ] The change works by "Smoke testing" or quick testing
  • [ NA ] The change has tests
  • [ NA ] The change has documentation

Other Information

image

Related issue

@WynonnaSun WynonnaSun self-assigned this Dec 8, 2025
/**
* HeaderCard – A statistic card with accent bar, value, label, and icon.
*/
export function HeaderCard({ value, label, variant }: HeaderCardProps) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to take props: color and icon, instead of variant

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the file name can be dashboard-card

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new HeaderCard UI component for displaying statistics in the admin dashboard. The component supports 4 variants (rooms, bookings, weekly, users) and follows the Bloom color palette with a left accent bar, value display, label, and icon.

  • Adds a reusable HeaderCard component with variant-based styling
  • Includes a test page showcasing all 4 card variants
  • Integrates with the existing Bloom color system

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
client/src/components/ui/header-card.tsx New statistic card component with 4 variants, each featuring a colored accent bar and icon
client/src/app/test/header-card/page.tsx Test page demonstrating all HeaderCard variants in a responsive grid layout

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Variant colors and icons mapping
const variantMap = {
rooms: {
color: "#F3D03A", // Yellow
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded hex color #F3D03A doesn't match the Bloom yellow color defined in the CSS variables (#f3d03aff). The CSS variable defines the color as #f3d03aff (with alpha channel), while this uses #F3D03A. Consider using Tailwind's bg-bloom-yellow class or the CSS variable var(--bloom-yellow) for consistency with the rest of the codebase.

Suggested change
color: "#F3D03A", // Yellow
color: "var(--bloom-yellow)", // Bloom yellow (from CSS variable)

Copilot uses AI. Check for mistakes.
Icon: Building,
},
bookings: {
color: "#67D4EC", // Primary blue
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded hex color #67D4EC doesn't match the Bloom blue color defined in the CSS variables (#67d4ecff). The CSS variable defines the color as #67d4ecff (with alpha channel), while this uses #67D4EC. Consider using Tailwind's bg-bloom-blue class or the CSS variable var(--bloom-blue) for consistency with the rest of the codebase.

Suggested change
color: "#67D4EC", // Primary blue
color: "var(--bloom-blue)", // Primary blue

Copilot uses AI. Check for mistakes.
Icon: Calendar,
},
weekly: {
color: "#BE1B3B", // Bloom red
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded hex color #BE1B3B doesn't match the Bloom red color defined in the CSS variables (#be1b3bff). The CSS variable defines the color as #be1b3bff (with alpha channel), while this uses #BE1B3B. Consider using Tailwind's bg-bloom-red class or the CSS variable var(--bloom-red) for consistency with the rest of the codebase.

Suggested change
color: "#BE1B3B", // Bloom red
color: "var(--bloom-red)", // Bloom red

Copilot uses AI. Check for mistakes.
Icon: ClipboardList,
},
users: {
color: "#2332FF", // Orbit blue
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded hex color #2332FF doesn't match the Bloom orbit color defined in the CSS variables (#2332ffff). The CSS variable defines the color as #2332ffff (with alpha channel), while this uses #2332FF. Consider using Tailwind's bg-bloom-orbit class or the CSS variable var(--bloom-orbit) for consistency with the rest of the codebase.

Suggested change
color: "#2332FF", // Orbit blue
color: "var(--bloom-orbit)", // Orbit blue (from CSS variable)

Copilot uses AI. Check for mistakes.
<div
className={cn(
"relative flex items-center justify-between rounded-lg bg-white p-4 pl-6 shadow-sm",
"border border-[#E5E1E6]", // Bloom gray border
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded hex color #E5E1E6 for the border doesn't match the Bloom gray color defined in the CSS variables (#e5e1e6ff). Consider using Tailwind's border-bloom-gray class or the CSS variable var(--bloom-gray) for consistency with the rest of the codebase.

Suggested change
"border border-[#E5E1E6]", // Bloom gray border
"border border-bloom-gray", // Bloom gray border

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +66
<div
className={cn(
"relative flex items-center justify-between rounded-lg bg-white p-4 pl-6 shadow-sm",
"border border-[#E5E1E6]", // Bloom gray border
)}
>
{/* Accent bar */}
<div
className="absolute bottom-0 left-0 top-0 w-2 rounded-l-lg"
style={{ backgroundColor: config.color }}
/>

{/* Value + label */}
<div className="flex flex-col">
<span className="text-2xl font-semibold text-black">{value}</span>
<span className="text-sm text-black">{label}</span>
</div>

{/* Icon */}
<div
className="flex h-10 w-10 items-center justify-center rounded-full border-2 bg-white"
style={{ borderColor: config.color }}
>
<Icon className="h-5 w-5" style={{ color: config.color }} />
</div>
</div>
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The card component lacks proper semantic HTML structure and ARIA attributes. Consider wrapping this in a <article> or <section> tag, and add role="region" with aria-labelledby pointing to the label for better screen reader support. Additionally, the value should be announced properly by screen readers.

Copilot uses AI. Check for mistakes.
className="flex h-10 w-10 items-center justify-center rounded-full border-2 bg-white"
style={{ borderColor: config.color }}
>
<Icon className="h-5 w-5" style={{ color: config.color }} />
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon is purely decorative and should have aria-hidden="true" to prevent screen readers from announcing it, since the meaning is already conveyed by the label text.

Suggested change
<Icon className="h-5 w-5" style={{ color: config.color }} />
<Icon className="h-5 w-5" style={{ color: config.color }} aria-hidden="true" />

Copilot uses AI. Check for mistakes.
@ErikaKK
Copy link
Contributor

ErikaKK commented Dec 10, 2025

the screenshot looks great, can make it in client/src/app/admin/dashboard/card.tsx to use in the dashboard later on

@WynonnaSun WynonnaSun closed this Jan 10, 2026
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.

Dashboard Header Card - 4 variants

3 participants