frondend/app/page.tsx

34 lines
804 B
TypeScript
Raw Normal View History

2024-09-24 12:47:24 +08:00
import Image from "next/image";
2024-10-05 15:04:17 +08:00
import Home from "../components/Home/Home";
import { fetchCourses, fetchSettings} from "../utils/index";
import { CoursesProps } from "@/types";
import ResponsiveNav from "../components/Navbar/ResponsiveNav";
type Props = {}
2024-09-24 12:47:24 +08:00
2024-10-05 15:04:17 +08:00
async function getCourses() {
const courses = await fetchCourses();
return courses;
}
async function getSettings(){
const settings = await fetchSettings();
return settings;
}
2024-09-24 12:47:24 +08:00
2024-10-05 15:04:17 +08:00
export const metadata = {
title: "All In One",
description: "**",
}
export default async function HomePage({ }: Props) {
const courses = await getCourses();
const settings = await getSettings();
return (
<div>
<ResponsiveNav courses={courses} settings={settings} />
<Home courses={courses} settings={settings} />
2024-09-24 12:47:24 +08:00
</div>
);
}
2024-10-05 15:04:17 +08:00