'use server';
import { MaindasboardPageProps } from "@/validations/mutual/dashboard/props";
import { DashboardLayout } from "@/layouts/dashboard/layout";
import { redirect } from "next/navigation";
import { checkAccessTokenIsValid } from "@/apifetchers/mutual/cookies/token";

const MainEnPage: React.FC<MaindasboardPageProps> = async ({ params, searchParams }) => {
  const parameters = await params;
  const searchParameters = await searchParams;
  const tokenValid = await checkAccessTokenIsValid()
  if (!tokenValid) { redirect("/auth/login") }
  return <div className="flex flex-col items-center justify-center"><DashboardLayout params={parameters} searchParams={searchParameters} lang="en" /></div>
}

export default MainEnPage;
