
import { getServerSession } from 'next-auth';
import { redirect } from 'next/navigation';
import { authOptions } from '@/lib/auth';

export const dynamic = 'force-dynamic';

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

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

  // Only allow admin and sales
  if (session.user.role === 'CUSTOMER' || session.user.role === 'CONTRACTOR') {
    redirect('/dashboard');
  }

  return (
    <div className="container mx-auto py-8 space-y-6">
      <div>
        <h1 className="text-3xl font-bold gradient-text">CRM Export</h1>
        <p className="text-muted-foreground mt-1">
          Export tracking and handoff to external CRM systems
        </p>
      </div>

      <div className="bg-white rounded-lg border p-8 text-center">
        <p className="text-muted-foreground">
          CRM export feature coming soon.
        </p>
      </div>
    </div>
  );
}
