
import { getServerSession } from 'next-auth';
import { redirect } from 'next/navigation';
import { authOptions } from '@/lib/auth';
import { QuoteGeneratorClient } from '@/components/quotes/quote-generator-client';

export const dynamic = 'force-dynamic';

export default async function NewQuotePage() {
  const session = await getServerSession(authOptions);

  if (!session) {
    redirect('/auth/signin');
  }

  // Only allow admin and staff to create quotes
  if (session.user.role === 'CUSTOMER') {
    redirect('/customer/dashboard');
  }

  return <QuoteGeneratorClient />;
}
