@extends('layouts.app')
@section('title','Create Member')
@section('content')

<div class="row">
    <div class="col-md-12">
        <div class="tile">
            <div class="tile-title-w-btn">
                <h3 class="title"><i class="bi bi-list-ul"></i> {{__('lang.member')}}</h3>
                <a href="{{route('members.index')}}" class="btn btn-primary" title="{{__('lang.members')}}">
                    <i class='bi bi-list'></i>
                </a>
            </div>
            <div class="tile-body">
                <form action="{{route('members.store')}}" method="post">
                    @csrf
                    @include('member.partials._form')
                    <x-buttons.save />
                </form>
                <br>
                @if($lastMember)
                <div class="d-flex justify-content-between align-items-center">
                    <h3>{{__('lang.last_inserted_member')}}</h3>
                    @include('member.partials.actions', ['el' => $lastMember])
                </div>
                <table class="table table-sm table-striped">
                    <tr>
                        <th>ID</th>
                        <td>{{$lastMember->id}}</td>
                    </tr>
                    <tr>
                        <th>{{__('lang.name')}}</th>
                        <td>{{$lastMember->name}}</td>
                    </tr>
                    <tr>
                        <th>{{__('lang.email')}}</th>
                        <td>{{$lastMember->email}}</td>
                    </tr>
                    <tr>
                        <th>{{__('lang.phone')}}</th>
                        <td>{{$lastMember->phone}}</td>
                    </tr>
                    <tr>
                        <th>{{__('lang.address')}}</th>
                        <td>{{$lastMember->address}}</td>
                    </tr>
                    <tr>
                        <th>{{__('lang.details')}}</th>
                        <td>{{$lastMember->details}}</td>
                    </tr>
                </table>
                @endif
            </div>
        </div>
    </div>
</div>
@endsection