- types: Product/CaseStudy page types, CaseStudyBlockValue, FormBlockValue - services: product.service.ts, case.service.ts - app/products, app/cases: list + detail pages - blocks: CaseStudyCard, LeadForm (submits to /api/v1/custom/leads/) - Header nav: add 产品/案例 links
25 lines
704 B
TypeScript
25 lines
704 B
TypeScript
import Link from "next/link";
|
|
import type { CaseStudyBlockValue } from "@/types/wagtail";
|
|
|
|
export default function CaseStudyCard({ value }: { value: CaseStudyBlockValue }) {
|
|
if (!value.case_page) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<div className="mx-auto max-w-3xl px-6 py-8">
|
|
<Link
|
|
href={value.case_page.meta.html_url ?? "#"}
|
|
className="block rounded-3xl border border-slate-100 p-8 shadow-sm transition hover:shadow-md"
|
|
>
|
|
<h3 className="text-xl font-semibold text-slate-900">
|
|
{value.case_page.title}
|
|
</h3>
|
|
{value.summary && (
|
|
<p className="mt-2 text-slate-600">{value.summary}</p>
|
|
)}
|
|
</Link>
|
|
</div>
|
|
);
|
|
}
|