All files / src/app/(site)/support/tickets/new page.tsx

0% Statements 0/26
100% Branches 0/0
0% Functions 0/1
0% Lines 0/26

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                                                     
import { Metadata } from 'next';
import { redirect } from 'next/navigation';
import { auth } from '@/lib/auth/auth';
import NewTicketForm from '@/components/features/support/SupportPortal/NewTicketForm';

export const metadata: Metadata = {
  title: 'Submit a Support Ticket | Elite Events',
  description: 'Submit a new support request and we will get back to you as soon as possible.'};

export default async function NewTicketPage() {
  const session = await auth();

  if (!session?.user) {
    redirect('/signin?callbackUrl=/support/tickets/new');
  }

  return (
    <div className="max-w-2xl mx-auto px-4 py-8">
      <h1 className="text-2xl font-bold text-gray-900 dark:text-gray-100 mb-6">Submit a Support Ticket</h1>
      <NewTicketForm
        defaultEmail={session.user.email || ''}
        defaultName={session.user.name || ''}
      />
    </div>
  );
}