Landing pages gain a Footer section (1 to 4 columns of title and text, a legal line under a divider) whose phone numbers, emails and web addresses show as links. The Form block and a hero with a form may carry a thank-you text shown after sign-up, with the same links. Full-width heroes get a lighter shade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
60 lines
2.7 KiB
TypeScript
60 lines
2.7 KiB
TypeScript
import type { ReactNode } from "react";
|
|
import { CalendarDays, MapPin, type LucideIcon } from "lucide-react";
|
|
import PoweredBy from "@/app/components/app/PoweredBy";
|
|
import type { RegistrationInfo } from "@/app/lib/services/publicRegistration";
|
|
|
|
type EventHeader = Pick<RegistrationInfo, "companyName" | "eventName" | "startDate" | "endDate" | "location">;
|
|
|
|
// The public visitor page frame: one card on the page ground, event header first, PoweredBy under it.
|
|
export function VisitorCard({ event, title, children }: { event?: EventHeader; title?: string; children?: ReactNode }) {
|
|
return (
|
|
<div className="flex min-h-svh flex-col items-center bg-background px-4 py-8">
|
|
<main className="w-full max-w-md space-y-6 rounded-lg border bg-card p-6 shadow-card">
|
|
{event && (
|
|
<header className="space-y-2">
|
|
<p className="text-xs font-semibold tracking-wide text-primary uppercase">{event.companyName}</p>
|
|
<h1 className="text-2xl font-semibold">{title ?? event.eventName}</h1>
|
|
<p className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
<CalendarDays className="size-4 shrink-0" aria-hidden="true" />
|
|
<span>{event.startDate} - {event.endDate}</span>
|
|
</p>
|
|
<p className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
<MapPin className="size-4 shrink-0" aria-hidden="true" />
|
|
<span>{event.location}</span>
|
|
</p>
|
|
</header>
|
|
)}
|
|
{children}
|
|
</main>
|
|
<div className="mt-4"><PoweredBy /></div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
interface StateProps {
|
|
icon: LucideIcon;
|
|
heading: string;
|
|
text?: ReactNode;
|
|
action?: ReactNode;
|
|
role?: "status" | "alert";
|
|
tone?: "default" | "error";
|
|
/** The heading is the page's h1: for states shown without the card's event header. */
|
|
h1?: boolean;
|
|
iconClassName?: string;
|
|
}
|
|
|
|
// A message inside the card (thanks, inactive, closed). h2 under the event header's h1; h1 when the card has no event header.
|
|
export function VisitorState({ icon: Icon, heading, text, action, role, tone = "default", h1, iconClassName }: StateProps) {
|
|
const Heading = h1 ? "h1" : "h2";
|
|
return (
|
|
<div role={role} className="flex flex-col items-center gap-3 text-center">
|
|
<span className={`flex size-12 items-center justify-center rounded-full ${tone === "error" ? "bg-destructive/10 text-destructive" : "bg-accent text-accent-foreground"}`}>
|
|
<Icon className={`size-6 ${iconClassName ?? ""}`} aria-hidden="true" />
|
|
</span>
|
|
<Heading className="text-lg font-semibold text-balance">{heading}</Heading>
|
|
{text && <p className="text-sm text-muted-foreground [&_a]:font-medium [&_a]:text-primary [&_a]:underline">{text}</p>}
|
|
{action}
|
|
</div>
|
|
);
|
|
}
|