import ApexChart from "@/app/_components/ApexChart";
import FooterForm from "@/app/_components/FooterForm";
import ImageWithFallback from "@/app/_components/ImageWithFallback";
import { cmsService } from "@/hooks/useCmsQueries";
import { CmsResponse } from "@/types/TCms";
import { Metadata } from "next";
import Image from "next/image";
import Link from "next/link";
export const metadata: Metadata = {
title: "Opp lens - Marketing",
description:
"Automated tender management platform for SMEs. Find tailored tenders, automate document handling, and get real-time alerts. Win more opportunities with less effort.",
keywords:
"tender management, AI tender search, SME tenders, public procurement, automated bidding, tender alerts",
authors: [{ name: "PBL Partners AB" }],
openGraph: {
title: "Opp lens - AI-Powered Tender Management",
description: "Win more tenders automatically with our AI-powered platform",
type: "website",
locale: "en_US",
siteName: "Opp lens",
},
icons: {
icon: "/fav-icon.svg",
},
};
interface IProps {
params: { id: string };
}
export default async function Home({ params }: IProps) {
const { id } = params;
let cmsData: CmsResponse | null = null;
try {
cmsData = await cmsService.getCms(id);
} catch (error) {
console.error("Error fetching CMS data:", error);
}
console.log(cmsData);
const centerFrames = cmsData?.data.features.cards ?? [];
return (
<>
$
{cmsData?.data.chart.missed_amount ?? 1672}
total tender amount you missed today
{cmsData?.data.hero.title}
{cmsData?.data.hero.description}
{cmsData?.data.hero.button_text}
{cmsData?.data.features.title}
{cmsData?.data.features.description}
{centerFrames.map((frame, index) => (
{frame.title}
{frame.description}
))}
{cmsData?.data.challenges.title}
{cmsData?.data.challenges.description}
{cmsData?.data.challenges.cards.map((card) => (
-
{card.title}
{card.description}
))}
{cmsData?.data.advantages.title}
{cmsData?.data.advantages.cards.map((card) => (
{card.title}
{card.description}
))}
>
);
}
function ContactInfo({
icon,
contact,
href,
ariaLabel,
contactIconSrc,
}: {
icon: string;
contact: string;
href?: string;
ariaLabel: string;
contactIconSrc?: string;
}) {
return (
{href ? (
{contact}
) : (
{!!contactIconSrc && (
)}
{contact}
)}
);
}