import Home from "../components/Home/Home";
import { fetchCourses, fetchSettings } from "../utils/index";
import ResponsiveNav from "../components/Navbar/ResponsiveNav";
import Head from "next/head";

async function getCourses() {
  const courses = await fetchCourses();
  return courses;
}

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

export const metadata = {
  title: "All And One Music",
  description: "發掘你的音樂之路 - 專業音樂課程、樂器教學、音樂活動",
  icons: {
    icon: '/favicon.ico',
  },
}

export default async function HomePage() {
  const courses = await getCourses();
  const settings = await getSettings();
  return (
    <div>
      <link rel="icon" href="/favicon.ico" />

      <ResponsiveNav courses={courses} settings={settings} />
      <Home courses={courses} settings={settings} />
    </div>
  );
}

