Updated the whole website to work according to the CMS
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user