brackt/app/components/ui/SectionCardHeader.tsx
Chris Parsons 2bc1173621 Responsive league row layout and mobile polish
- League rows stack avatar+name on top, stats full-width below on mobile
- Stats spread to right side on sm+ screens with border separator on mobile
- Tighter padding on mobile (px-3/py-3), full padding on sm+
- Card headers and content use px-3 sm:px-6 to reduce mobile gutters
- Two-column home layout deferred to lg breakpoint (tablet gets stacked)
- Active leagues sorted by completion percentage descending
- Default rank 1 / 0 points for active leagues with no scoring events yet
- Fix ordinal bug for 11th/12th/13th; add aria-labels to rank change indicators
- Remove dead StatDivider className prop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 19:50:39 -07:00

28 lines
973 B
TypeScript

import type { ComponentType, ReactNode } from "react";
import type { LucideProps } from "lucide-react";
import { CardHeader } from "~/components/ui/card";
import { GradientIcon } from "~/components/ui/GradientIcon";
interface SectionCardHeaderProps {
icon: ComponentType<LucideProps>;
title: string;
right?: ReactNode;
}
/**
* Consistent header for top-level section cards (My Leagues, Create a League, etc.).
* Renders a gradient icon + xl bold title, with an optional right-side slot.
*/
export function SectionCardHeader({ icon, title, right }: SectionCardHeaderProps) {
return (
<CardHeader className="px-3 sm:px-6 pb-2">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<GradientIcon icon={icon} className="h-5 w-5 shrink-0" />
<h2 className="text-xl font-bold leading-none tracking-tight">{title}</h2>
</div>
{right}
</div>
</CardHeader>
);
}