import React from 'react'
import ResponsiveNav from "@/components/Navbar/ResponsiveNav";
import { fetchCourses, fetchSettings, fetchAboutus } from "@/utils";
import { CoursesProps, AboutusProps } from "@/types";
import Course from '@/components/Course/Course';
import dynamic from 'next/dynamic'
import Home from '@/components/Aboutus/Home';
async function getCourses() {
    const courses = await fetchCourses();
    return courses;
}

async function getAboutus() {
    const aboutus: AboutusProps[] = await fetchAboutus();
    return aboutus;
}

async function getSettings() {
    const settings = await fetchSettings();
    return settings;
}

export const metadata = {
    title: "All In One",
    description: "**",
}

export default async function Page({ params }: { params: { slug: string } }) {
    const courses = await getCourses();
    const settings = await getSettings();
    const aboutus = await getAboutus();
    //const course = await getCourse(params.slug);

    return (
        <div className='bg-[#F6E8E9]'>
            <ResponsiveNav courses={courses} settings={settings} />
            <Home courses={courses} settings={settings} aboutus={aboutus} />

        </div>
    )
}