@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>專案</th>
                            <th>類別</th>
                            <th>金額</th>
                            <th>日期</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                    @foreach($payments as $payment)
                        <tr>
                            <td>{{ $payment->id }}</td>
                            <td>{{ $payment->project->title }}</td>
                            <td>{{ __('enums.payment_type.' . $payment->type) }}</td>
                            <td>{{ $payment->amount }}</td>
                            <td>{{ $payment->created_at }}</td>
                            <td>
                                <a href="{{ route('adm.payment.show', [$payment->id]) }}" class="btn btn-sm btn-primary">
                                    <i class="bi bi-eye"></i>
                                </a>
                                <a href="{{ route('adm.payment.edit', [$payment->id]) }}" class="btn btn-sm btn-outline-secondary">
                                    <i class="bi bi-pencil"></i>
                                </a>
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
@endsection
