Updated the whole website to work according to the CMS

This commit is contained in:
Tiago Ribeiro
2024-03-19 01:02:07 +00:00
parent 91ee920b42
commit 5ee1364afb
36 changed files with 617 additions and 648 deletions

View File

@@ -3,12 +3,14 @@ import Navbar from "@/components/Navbar";
import Title from "@/components/Title";
import {Contact} from "@/types/contact";
import translation from "@/translation/agentcontacts.json";
import CountryManagerContactsPage from "@/types/cms/countryManagerContacts";
type Language = "en" | "ar";
interface Props {
country: string;
page: string;
language: Language;
data: CountryManagerContactsPage;
}
async function getCountryManagers(country: string, language: Language = "en") {
@@ -27,7 +29,7 @@ export async function generateStaticParamsHelper(language: Language = "en") {
country: key.toLowerCase().replaceAll(" ", ""),
}));
}
export async function AgentContacts({language, page, country}: Props) {
export async function AgentContacts({language, page, country, data}: Props) {
const contact = (await getCountryManagers(country, language)) as Contact;
return (
@@ -44,15 +46,15 @@ export async function AgentContacts({language, page, country}: Props) {
{contact.entries.map((entry) => (
<div key={entry.name}>
<h2>
<strong>{translation.name[language]}: </strong>
<strong>{data.Name}: </strong>
{entry.name}
</h2>
<p>
<strong>{translation.number[language]}: </strong>
<strong>{data.Number}: </strong>
{entry.number}
</p>
<p>
<strong>{translation.email[language]}: </strong>
<strong>{data.Email}: </strong>
{entry.email}
</p>
</div>