import { Metadata } from "next";
import { I18nProvider } from "@/i18n";
import { Suspense } from "react";
import { getServerI18n } from "@/i18n";
import DashboardPage from "@/components/DashboardPage";
import { SearchParams } from "@/app/utils/fetchUtil";

export const metadata: Metadata = {
  title: "Dashboard",
};

type Props = {
  
} & SearchParams

const Dashboard: React.FC<Props> = async ({
  searchParams
}) => {
  const { t } = await getServerI18n("dashboard");

  return (
    <I18nProvider namespaces={["dashboard", "common"]}>
      <Suspense fallback={<DashboardPage.Loading />}>
        <DashboardPage 
          searchParams={searchParams}
          />
      </Suspense>
    </I18nProvider>
  )
};

export default Dashboard;
