@extends('layouts.yellow')
@section('content')
    <div class="container-fluid">
        <div class="row">
            <div class="col-12 p-3">
            @if (Session::has('message'))
                    <div class="alert alert-info">
                        {{ Session::get('message') }}
                    </div>
                @endif
                
                <div class="card">
                    <div class="card-header">
                        <h2>{{ __('view-payments-methods.titleView') }}</h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-12">
                <div class="container-fluid">
                @if(session('error'))
            <div class="alert alert-danger alert-dismissible fade show">
                {{ session('error') }}
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        @endif
        
        @if(session('success'))
            <div class="alert alert-success alert-dismissible fade show">
                {{ session('success') }}
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        @endif
                    <div class="row">
                        <div class="col-12">
                            <div style="margin-left:100px">
                                <img class="w-40" src="{{asset('img/payment-method.png')}}" alt="">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            @if(isset($redirectToCreatePayment))
                             <x-PaymentMethodForm :redirectToCreatePayment=true></x-PaymentMethodForm>
                             @else
                             <x-PaymentMethodForm></x-PaymentMethodForm>
                            @endif
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            <livewire:payments-method-table-view />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="{{ asset('js/create-payment-method.js') }}"></script>
@endsection