import { auth } from '@/auth';
import PageContainer from '@/components/layout/page-container';
import { EmailConfigurationPage } from '@/features/foundation/email/components/email-configuration-page';

export const metadata = {
  title: 'Dashboard: Email Configuration',
};

export default async function AdministrationEmailPage() {
  const session = await auth();
  const canAccess = session?.user?.systemRole === 'super_admin';

  return (
    <PageContainer
      pageTitle='Administration Email Configuration'
      pageDescription='Configure secure SMTP delivery for setup checks, notifications, approvals, and future email workflows.'
      access={canAccess}
      accessFallback={
        <div className='rounded-lg border border-dashed p-8 text-center text-muted-foreground'>
          Email configuration requires a super admin account.
        </div>
      }
    >
      <EmailConfigurationPage />
    </PageContainer>
  );
}
