<x-layouts.dashboard>

    <div class="page-shell">

        <div class="page-header">

            <div>
                <span class="eyebrow">
                    Creators
                </span>

                <h1>
                    Add Author
                </h1>

                <p>
                    Create an author profile and associate the creator
                    with an approved publishing organisation where applicable.
                </p>
            </div>


            <a
                href="{{ route('authors.index') }}"
                class="btn btn--secondary"
            >
                Cancel
            </a>

        </div>


        @if ($errors->any())

            <div class="alert alert-error">

                <strong>
                    The author could not be saved.
                </strong>

                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>

            </div>

        @endif


        <form
            method="POST"
            action="{{ route('authors.store') }}"
            enctype="multipart/form-data"
        >

            @csrf

            <x-forms.author
                :publishers="$publishers"
            />

        </form>

    </div>

</x-layouts.dashboard>