frondend/app/page.tsx

37 lines
905 B
TypeScript
Raw Permalink Normal View History

2024-10-05 15:04:17 +08:00
import Home from "../components/Home/Home";
2024-10-08 19:08:37 +08:00
import { fetchCourses, fetchSettings } from "../utils/index";
2024-10-05 15:04:17 +08:00
import ResponsiveNav from "../components/Navbar/ResponsiveNav";
2024-10-08 19:08:37 +08:00
import Head from "next/head";
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;
}
2024-10-08 19:08:37 +08:00
async function getSettings() {
2024-10-05 15:04:17 +08:00
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 = {
2024-10-28 21:13:57 +08:00
title: "One And All Music",
2024-10-28 20:48:46 +08:00
description: "發掘你的音樂之路 - 專業音樂課程、樂器教學、音樂活動",
2024-10-08 19:08:37 +08:00
icons: {
icon: '/favicon.ico',
},
2024-10-05 15:04:17 +08:00
}
2024-10-08 15:11:16 +08:00
export default async function HomePage() {
2024-10-05 15:04:17 +08:00
const courses = await getCourses();
const settings = await getSettings();
return (
<div>
2024-10-08 19:08:37 +08:00
<link rel="icon" href="/favicon.ico" />
<ResponsiveNav courses={courses} settings={settings} />
2024-10-05 15:04:17 +08:00
<Home courses={courses} settings={settings} />
2024-09-24 12:47:24 +08:00
</div>
);
}
2024-10-05 15:04:17 +08:00