@extends('admin.masterAdmin')

@section('content')
    <div class="row">
        <div class="col-lg-12">
            <div class="card card-fullheight">
                <div class="card-header">
                    <h5 class="box-title">{{ isset($mission) ? 'Update Mission' : 'Add Mission' }}</h5>
                </div>

                <div class="card-body">
                    @include('components.alert')

                    <form action="{{ route('mission.update', $mission->id) }}" method="PUT" enctype="multipart/form-data">

                        @csrf
                        {{-- Name --}}
                        <div class="mb-3">
                            <label for="name" class="form-label">Title <span class="text-danger">*</span></label>
                            <input type="text" name="name" id="name" class="form-control"
                                value="{{ old('name', $mission->name ?? '') }}" required>
                        </div>

                        {{-- Description --}}
                        <div class="mb-3">
                            <label for="desc" class="form-label">Description</label>
                            <textarea name="description" id="desc" class="form-control" rows="4">{{ old('description', $mission->description ?? '') }}</textarea>
                        </div>
                        {{-- Buttons --}}
                        <div class="mt-4">
                            <button type="submit" class="btn btn-success">
                                {{ isset($mission) ? 'Update' : 'Save' }}
                            </button>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
