@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row justify-content-center">
            <h3 class="mb-4">Manager</h3>
            @if($artist->manager != null)
                <div class="manager mb-2 justify-content-between">
                    <form action="/{{Auth::user()->username}}/manager/remove" method="POST">
                        @csrf
                        <h5 class="float-start">{{ $artist->manager->user->name . ' | ' . $artist->manager->user->email }}</h5>
                        <button type="submit" class="btn btn-danger float-end">Remove Manager</button>
                    </form>
                </div>
            @else
                <h5 class="mb-2">Invite Manager</h5>
                <form action="/artists/manager/invite" method="POST">
                    @csrf
                    <div class="mb-3">
                        <label for="managerEmail" class="form-label">Email address</label>
                        <input type="email" class="form-control" id="managerEmail" name="email"
                               placeholder="name@example.com" required>
                        <button type="submit" class="btn btn-primary mt-2">Invite</button>
                    </div>
                </form>
            @endif
        </div>
    </div>
@endsection
