@extends('layouts.admin')

@section('content')
  @php
    $contestType = $contest_type ?? 'paid';
    $pageTitle = $assignment_add_title ?? 'Add Assign Competition Exam';
    $heroTitle = $assignment_add_title ?? 'Create Competition Assignment';
    $heroDescription = $assignment_hero_create ?? 'Map competition, class group, board pattern and question sets into one scheduled exam assignment.';
    $formAction = isset($assign_save_route_name) ? route($assign_save_route_name) : route('admin.saveassigncompetition');
    $backRouteName = $assign_route_name ?? ($contestType === 'free' ? 'admin.freeassigncompetition' : 'admin.assigncompetition');
  @endphp
  <div class="card-header">
    <h4>{{ $pageTitle }}</h4>
  </div>
  <div class="card-body">
    @include('admin.partials.flash-messages')
    @include('admin.assigncompitetions.partials.assignment-form', [
        'heroTitle' => $heroTitle,
        'heroDescription' => $heroDescription,
        'formAction' => $formAction,
        'submitLabel' => 'Save Assignment',
        'contestType' => $contestType,
        'contestTypeLabel' => $contest_type_label ?? 'Paid Competition',
        'backRouteName' => $backRouteName,
    ])
  </div>
@endsection
