@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row justify-content-center">
            <h3 class="mb-3">Create Offer</h3>
            <h5 class="mb-4">Send Proposal to {{ $artist->user->name }}</h5>
            <form method="POST" action="/offers/create">
                @csrf
                <input type="hidden" name="artist_id" value="{{ $artist->user_id }}">
                @if (count($events) > 0)
                    <label for="event_id">Choose event</label>
                    <br/>
                    <select name="event_id" class="form-select" id="event_id">
                        @foreach($events as $event)
                            <option value="{{ $event->id }}">{{ $event->title }}</option>
                        @endforeach
                    </select>
                    <br>

                    <button type="submit" class="btn btn-primary d-flex mt-4 mb-3">Send Request</button>
                @endif
                <a href="/events/create/{{ $artist->user->username }}">Create new event</a>
            </form>
        </div>
    </div>
@endsection
