@view('header', [ 'title' => 'Create account - Accounts' ])

<div class="breadcrumb">
    <ul>
        <li><a href="/">Banq</a></li>
        <li><a href="/accounts">Accounts</a></li>
        <li class="is-active"><a href="/accounts/create">Create</a></li>
    </ul>
</div>

<h1 class="title">Create account</h1>

@view('errors')

<form method="post" action="/accounts">
    @view('csrf_token')

    <div class="field">
        <label class="label" for="name">Name</label>
        <input class="input" type="text" id="name" name="name" value="{{ old('name') }}" {{ !isset($errors) ? 'autofocus' : '' }} required>
    </div>

    <div class="field">
        <label class="label" for="type">Type</label>
        <select class="input" id="type" name="type" required>
            <option value="" disabled {{ old('type') == '' ? 'selected' : '' }}>Choose a type</option>
            <option value="{{ Accounts::TYPE_SAVE }}" {{ old('type') == Accounts::TYPE_SAVE ? 'selected' : '' }}>Save</option>
            <option value="{{ Accounts::TYPE_PAYMENT }}" {{ old('type') == Accounts::TYPE_PAYMENT ? 'selected' : '' }}>Payment</option>
        </select>
    </div>

    <div class="field">
        <button class="button is-link" type="submit">Create account</button>
    </div>
</form>

@view('footer')
