import Link from "next/link";
import {CheckCircle2} from "lucide-react";
import {
IconCardProps,
MetricContent, PricingTierContent,
SectionIntroContent, WorkflowStepContent,
} from "./types";
/** 首页区块上方的小号眉标文字。 */
export function Eyebrow({children}: { children: React.ReactNode }) {
return (
{children}
);
}
/**
* 首页复用的区块标题结构。
* 多个区块共享同一套标题层级,集中在这里可以避免字号和间距漂移。
*/
export function SectionIntro({
intro,
align = "center",
}: {
intro: SectionIntroContent;
align?: "center" | "left";
}) {
const wrapperClassName =
align === "center" ? "mx-auto max-w-2xl text-center" : "max-w-2xl text-left";
return (
{intro.eyebrow &&
{intro.eyebrow}}
{intro.title}
{intro.body && (
{intro.body}
)}
);
}
/** 数据条中的单个指标展示。 */
export function MetricStat({metric}: { metric: MetricContent }) {
return (
{metric.number}
{metric.label}
);
}
/** 首页复用的图标说明卡,支持问题区和方案区两种密度。 */
export function IconCard({Icon, title, body, variant = "default"}: IconCardProps) {
const iconSize = variant === "problem" ? "md" : "sm";
const bodyClassName =
variant === "problem"
? "mt-3 text-sm leading-relaxed text-muted-foreground"
: "mt-2 text-sm leading-relaxed text-muted-foreground";
return (
);
}
/** 工作流程区块的单个步骤卡片。 */
export function WorkflowStepCard({step}: { step: WorkflowStepContent }) {
return (
{step.number}
{step.eyebrow}
{step.title}
{step.body}
);
}
/** 定价区的单个套餐卡片,包含高亮态和转化入口。 */
export function PricingTierCard({tier}: { tier: PricingTierContent }) {
const TierIcon = tier.Icon;
const cardClassName = tier.isHighlighted
? "marketing-lift relative flex h-full flex-col rounded-2xl border-2 border-foreground bg-card p-7 shadow-lg"
: "marketing-lift relative flex h-full flex-col rounded-2xl border border-border bg-card p-7 shadow-sm";
const ctaClassName = tier.isHighlighted
? "mt-6 inline-flex h-10 w-full items-center justify-center rounded-md bg-foreground px-5 text-sm font-medium text-background transition-opacity hover:opacity-90"
: "mt-6 inline-flex h-10 w-full items-center justify-center rounded-md border border-border bg-background px-5 text-sm font-medium transition-colors hover:bg-accent";
return (
{tier.badge && (
{tier.badge}
)}
{tier.name}
{tier.price}
{tier.unit && {tier.unit}}
{tier.note &&
{tier.note}
}
{tier.features.map((feature) => (
-
{feature}
))}
{tier.cta.label}
);
}
/** 常见问题区块的折叠问答项。 */
export function FaqDisclosure({question, answer}: { question: string; answer: string }) {
return (
{question}
v
{answer}
);
}
/** 卡片内部统一的小图标容器,保证所有图标尺寸和底色一致。 */
function IconBubble({Icon, size}: { Icon: IconCardProps["Icon"]; size: "sm" | "md" }) {
const boxClassName =
size === "md"
? "inline-flex h-10 w-10 items-center justify-center rounded-md bg-foreground/[0.04] text-foreground/80 ring-1 ring-foreground/[0.06]"
: "inline-flex h-9 w-9 items-center justify-center rounded-md bg-foreground/[0.04] text-foreground/80 ring-1 ring-foreground/[0.06]";
const iconClassName = size === "md" ? "h-5 w-5" : "h-[18px] w-[18px]";
return (
);
}