Files
co-lite/solvway-admin-portal/app/lib/pageTemplates.ts
T

63 lines
2.5 KiB
TypeScript

import type { CmsBlock } from "@/app/lib/cmsPages";
// add-page-drafts-and-templates: starter pages for marketing staff. Placeholder text in English, no images, the
// sign-up form without an event (staff choose it) and named "signup" so every button can link to it.
export interface PageTemplate {
id: "EVENT" | "SHOWCASE";
label: string;
description: string;
blocks: () => CmsBlock[];
}
const hero = (): CmsBlock => ({
type: "HERO", look: "DARK", heading: "Your event headline",
text: "One or two sentences on what visitors get and why they should come.",
buttonLabel: "Sign up now", buttonUrl: "#signup",
});
const trust = (): CmsBlock => ({
type: "TRUST", cards: [{ title: "Trusted by 500+ customers" }, { title: "Local support team" }, { title: "Free consultation" }],
});
const features = (): CmsBlock => ({
type: "FEATURES", heading: "What you get", text: "A short line introducing the benefits.",
cards: [
{ icon: "star", title: "First benefit", text: "Describe the first benefit in a sentence." },
{ icon: "shield-check", title: "Second benefit", text: "Describe the second benefit in a sentence." },
{ icon: "headset", title: "Third benefit", text: "Describe the third benefit in a sentence." },
],
});
const steps = (look?: CmsBlock["look"]): CmsBlock => ({
type: "STEPS", ...(look ? { look } : {}), heading: "How it works",
cards: [
{ title: "Sign up", text: "Fill in the form below." },
{ title: "We contact you", text: "Our team calls you to confirm the details." },
{ title: "Enjoy", text: "Say what happens next." },
],
});
const faq = (): CmsBlock => ({
type: "FAQ", heading: "Questions",
items: [
{ question: "A question visitors often ask?", answer: "The answer to it." },
{ question: "Another common question?", answer: "The answer to it." },
],
});
const form = (): CmsBlock => ({ type: "FORM", look: "MUTED", anchor: "signup", heading: "Sign up", eventUuid: null });
export const PAGE_TEMPLATES: PageTemplate[] = [
{
id: "EVENT", label: "PagesTemplateEvent", description: "PagesTemplateEventHint",
blocks: () => [hero(), trust(), features(), steps("MUTED"), faq(), form()],
},
{
id: "SHOWCASE", label: "PagesTemplateShowcase", description: "PagesTemplateShowcaseHint",
blocks: () => [hero(), trust(), features(), steps(), faq(),
{ type: "CTA", look: "ACCENT", heading: "Ready to start?", text: "One line that asks visitors to act.", buttonLabel: "Sign up", buttonUrl: "#signup" },
form()],
},
];