import Image from "next/image"; import Link from "next/link"; import { Check } from "lucide-react"; import type { CmsProductContent } from "@/types/cms-landing"; const DEFAULT_TITLE = "The product we offer is designed to meet your business needs."; const DEFAULT_BODY = "Social media marketing services are provided by companies or individuals who specialize in marketing strategies through social media platforms."; function cardImageUrl(p: CmsProductContent) { return p.images?.[0]?.image_url?.trim() || "/image/p1.png"; } /** Normalize CMS link: relative paths and full URLs; bare domains get https:// */ function resolveProductLink(raw: string | undefined | null): string | null { const t = raw?.trim(); if (!t) return null; if (/^(https?:|\/|#|mailto:)/i.test(t)) return t; return `https://${t}`; } function LearnMoreCta({ href }: { href?: string | null }) { const resolved = resolveProductLink(href); const className = "inline-flex text-sm font-semibold text-[#966314] hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#966314]"; if (!resolved) return null; if (resolved.startsWith("/")) { return ( Learn More → ); } return ( Learn More → ); } /** Renders "Label: rest" with a bold label when a colon is present (one colon split). */ function BulletLine({ text }: { text: string }) { const idx = text.indexOf(":"); if (idx > 0 && idx < text.length - 1) { const label = text.slice(0, idx).trim(); const rest = text.slice(idx + 1).trim(); return ( <> {label}: {rest} > ); } return <>{text}>; } function ProductImageBlock({ imgSrc, alt, }: { imgSrc: string; alt: string; }) { const external = /^https?:\/\//i.test(imgSrc); return (
{p.secondary_title.trim()}
) : null} {useBullets ? ({bodyText}
)}Our Product
{DEFAULT_BODY}
Our Product