/* ============================================================================
Card.Content - Figma 25:752 (360 x 372)
----------------------------------------------------------------------------
The news / blog / programme card: image, category badge, eyebrow, title,
excerpt and a "Read more" affordance. The whole card is one link.
USAGE
-----
// Arabic - the copy is the only thing that changes, RTL mirrors itself.
// Above the fold - skip lazy loading for the lead card only.
========================================================================= */
import {
CardActionHint,
CardEyebrow,
CardLink,
CardMedia,
CardShell,
cx,
} from "./CardShell";
import type { CardElement, CardImage, CardTitleElement } from "./types";
export interface CardContentProps {
/** Where the whole card goes. */
href: string;
title: string;
/**
* Label of the "Read more" affordance. Required rather than defaulted so an
* Arabic page cannot silently ship the English string.
*/
actionLabel: string;
/** Accent kicker above the title, rendered uppercase. */
eyebrow?: string;
excerpt?: string;
/** Chip over the top-inline-start corner of the image ("Rule of Law"). */
badge?: string;
image?: CardImage;
as?: CardElement;
/** Heading level - match the surrounding page outline. */
titleAs?: CardTitleElement;
className?: string;
}
export function CardContent({
href,
title,
actionLabel,
eyebrow,
excerpt,
badge,
image,
as = "article",
titleAs = "h3",
className,
}: CardContentProps) {
const Title = titleAs;
return (
{image ? (
{/* The chip sits on a scrim over the photo, so its label has to stay
light on both surfaces - text-on-accent is the only always-white
role, text-primary would go dark on the light surface. */}
{badge ? (
{badge}
) : null}
) : null}
{eyebrow ?
{eyebrow} : null}
{title}
{excerpt ? (
{excerpt}
) : null}
);
}