import type { Metadata } from 'next';
import { redirect } from 'next/navigation';
import { isAuthenticatedNextjs } from '@convex-dev/auth/nextjs/server';

export const generateMetadata = (): Metadata => {
  return {
    title: 'Profile',
    robots: {
      index: false,
      follow: false,
      googleBot: {
        index: false,
        follow: false,
      },
    },
  };
};

const ProfileLayout = async ({
  children,
}: Readonly<{ children: React.ReactNode }>) => {
  if (!(await isAuthenticatedNextjs())) redirect('/sign-in');
  return <>{children}</>;
};
export default ProfileLayout;
