Become a Pro / website · becomeapro.ai / src / components / page-intro.tsx
| 1 | import type { ReactNode } from "react"; |
| 2 | import { cn } from "@/lib/utils"; |
| 3 | |
| 4 | // The opening of an inner page: mono label, large display title, and a lead paragraph |
| 5 | export function PageIntro({ |
| 6 | label, |
| 7 | title, |
| 8 | lead, |
| 9 | color, |
| 10 | className, |
| 11 | children, |
| 12 | }: { |
| 13 | label?: string; |
| 14 | title: string; |
| 15 | lead?: ReactNode; |
| 16 | color?: string; |
| 17 | className?: string; |
| 18 | children?: ReactNode; |
| 19 | }) { |
| 20 | return ( |
| 21 | <div className={cn("max-w-4xl", className)} style={color ? ({ "--tc": color } as React.CSSProperties) : undefined}> |
| 22 | {label && ( |
| 23 | <p className="label"> |
| 24 | <i /> |
| 25 | {label} |
| 26 | </p> |
| 27 | )} |
| 28 | <h1 className="display-title mt-6 text-[clamp(44px,6.4vw,96px)]">{title}</h1> |
| 29 | {lead && <p className="mt-6 max-w-2xl text-[clamp(17px,1.35vw,20px)] leading-relaxed text-[var(--mist)]">{lead}</p>} |
| 30 | {children} |
| 31 | </div> |
| 32 | ); |
| 33 | } |