<%- 
  content_for :title, t('what_is_your_name')  
%>


<%= form_with model: @player, url: url_for(controller: 'players', action: 'create') do |form| %>
  
  <div class="question-container">
  
    <div class="animation-element">
      <div class="question-header">
        <div class="typewriter-text"><%= t 'what_is_your_name' %></div>
      </div>
    </div>

    <% if form.object.errors.any? %>    
    <div class="animation-element">
      <div class="error">
        <% form.object.errors.messages.each do |k, v| %>
          <%= v.join(', ') %>
        <% end %>
      </div>
    </div>
    <% end %>  
    
    <div class="animation-element">
      <%= form.label :name, class: "question-answer" do %>    
        <%= form.text_field :name, placeholder: t('what_is_your_name') %>
      <% end %>
    </div>
    
    <div class="animation-element">
      <%= form.button tag.span(t('submit')), 
                      class: 'button__base'  %>
    </div>
  
  </div>

<% end %>