@extends('iqec.layouts.app')

@section('content')
    <div class="container-fluid">
        <div class="row page-titles">
            <ol class="breadcrumb">
                @if (auth()->user()->isPromoter())
                    <li class="breadcrumb-item"><a href="{{ route('authorised-partners.index') }}">Authorised Partners</a></li>
                @else
                    <li class="breadcrumb-item"><a href="{{ route('courseware-partners.index') }}">Courseware Partners</a></li>
                @endif
                <li class="breadcrumb-item active"><a href="javascript:void(0)">Details</a></li>
            </ol>
        </div>
        @include('iqec.partials.flash')
        <div class="card">
            <div class="card-header d-flex justify-content-between">
                <h4 class="card-title mb-0">{{ $coursewarePartner->applicant_name }}</h4>
                <span class="badge {{ $coursewarePartner->user->status->badgeClass() }}">{{ $coursewarePartner->user->status->label() }}</span>
            </div>
            <div class="card-body">
                <p><strong>Email:</strong> {{ $coursewarePartner->email }}</p>
                <p><strong>Institute:</strong> {{ $coursewarePartner->institute_name }}</p>
                <p><strong>Website:</strong> {{ $coursewarePartner->website }}</p>
                <p><strong>Authorised partner:</strong> {{ $coursewarePartner->authorisedPartner?->applicant_name ?: 'None' }}</p>
                <p><strong>Category:</strong> {{ $coursewarePartner->category?->name ?: 'None' }}</p>
                <p><strong>Requirements:</strong> {{ $coursewarePartner->requirements }}</p>
                @can('update', $coursewarePartner)
                    <a href="{{ route('courseware-partners.edit', $coursewarePartner) }}" class="btn btn-primary" onclick="return confirm('Are you sure you want to edit this courseware partner?')">Edit</a>
                @endcan
                <a href="{{ auth()->user()->isPromoter() ? route('authorised-partners.index') : route('courseware-partners.index') }}" class="btn btn-light">Back</a>
            </div>
        </div>
    </div>
@endsection
