@extends('admin.layouts.app')
@section('title', 'Payment Processes')
@section('content')
<div class="action-bar">
    <span>{{ $paymentProcesses->total() }} payment processes</span>
    <a href="{{ route('admin.payment-processes.create') }}" class="btn btn-primary">+ New Payment Process</a>
</div>
<div class="card">
    <table>
        <tr><th>Desktop Image</th><th>Mobile Image</th><th>Title</th><th>Active</th><th>Actions</th></tr>
        @foreach($paymentProcesses as $item)
        <tr>
            <td>@if($item->image_desktop)<img src="{{ asset('storage/'.$item->image_desktop) }}" class="product-img" alt="">@else—@endif</td>
            <td>@if($item->image_mobile)<img src="{{ asset('storage/'.$item->image_mobile) }}" class="product-img" alt="">@else—@endif</td>
            <td><strong>{{ $item->title ?? '—' }}</strong></td>
            <td>{!! $item->is_active ? '<span style="color:#6fcf97">Yes</span>' : '<span style="color:#e74c3c">No</span>' !!}</td>
            <td class="inline-flex">
                <a href="{{ route('admin.payment-processes.edit', $item) }}" class="btn btn-primary btn-sm">Edit</a>
                <form action="{{ route('admin.payment-processes.destroy', $item) }}" method="POST" onsubmit="return confirm('Delete?')">
                    @csrf @method('DELETE')
                    <button type="submit" class="btn btn-danger btn-sm">Delete</button>
                </form>
            </td>
        </tr>
        @endforeach
    </table>
    <div class="pagination">{{ $paymentProcesses->links() }}</div>
</div>
@endsection
