@extends('admin.layouts.container')

@section('content')
<div class="side-title">
    <h3>{{$head ?? '' }}</h3>
</div>
<div class="border-item">
    <form class="form-row" method="post" action="{{ $action }}">
        @if($contact ?? ''  && $contact->id)
            @method('PUT')
        @endif
        @csrf
        @foreach($languages as $language)
        <div class="form-group col-lg-6">
            <label>{{ meta('title', $language->local) ?? __('contacts.title') }}  </label>
            <input type="text" class="form-control {{ $errors->has('title_'.$language->local) ? 'is-invalid' : '' }}" name="title_{{ $language->local }}" placeholder="{{ meta('title', $language->local) ?? __('contacts.title') }}" value='{{ old("title_{$language->local}", $contact[$language->local]->title ?? "") }}'/>
        </div>
        @endforeach

        @foreach($languages as $language)
        <div class="form-group col-lg-12">
            <label>{{ meta('description', $language->local) ?? __('contacts.description')}}  </label>
            <textarea name="description_{{ $language->local }}" rows="5" class="form-control {{ $errors->has('description_'.$language->local) ? 'is-invalid' : '' }}" placeholder="{{ meta('description', $language->local) ?? __('contacts.description')}}">{{ old("description_{$language->local}", $contact[$language->local]->description ?? "") }}</textarea>
        </div>
        @endforeach

        <div class="text-center mt-5 col-12">
            <button class="butn"><span>{{ __('dashboard.save') }}</span></button>
        </div>
    </form>
</div>

@endsection
