@extends('front.layouts.master-auth') @section('content')

@lang('Balance')

@if($hasPendingWithdraw)
@lang('Attention')! @lang('front.You have a pending withdrawal request with amount of :amount. Please wait for admin approval before proceeding.', ['amount' => $hasPendingWithdraw->amount])
@endif
@lang('Charge Wallet') @if($user->profit_balance > 0) @if(!$hasPendingWithdraw) @lang('front.Withdraw balance') @endif @endif
{{--

@lang('Balance')

--}}
@lang('Available to withdraw')
{{$amountToUse}} $

@lang('The balance you deposited, which you can use to pay for the project auction.')

@lang('The Pending')
{{$pendingAmount}} $

@lang('It includes the budget of your ongoing projects and any amount you requested to withdraw that is still in transfer, in addition to your profits in the last 14 days.')

@lang('Balance To Withdraw')
{{$amountProfit}} $

@lang('It includes your profits from projects that can be withdrawn.')

@lang('Transactions')

{{-- --}} @if($transactions->count() > 0) @foreach($transactions as $key => $transaction) {{-- --}} @php $isDebit = in_array($transaction->type, ['deposit', 'withdraw', 'service_charge']); @endphp @endforeach @else @endif
--}} {{--
--}} {{-- #--}} {{--
--}} {{--
@lang('Amount')
@lang('Transaction Type')
@lang('Details')
@lang('Status')
@lang('Time')
--}} {{-- {{++$key}}--}} {{-- {{ $isDebit ? '-' : '+' }}{{ number_format($transaction->amount, 2) }} @php $typeBadge = match($transaction->type) { 'withdraw' => ['label' => __('Withdraw'), 'class' => 'withdraw'], 'deposit' => ['label' => __('Deposit'), 'class' => 'deposit'], 'profit' => ['label' => __('Profit'), 'class' => 'profit'], 'charge' => ['label' => __('Charge'), 'class' => 'charge'], 'service_charge' => ['label' => __('Service Charge'), 'class' => 'service-charge'], 'refund' => ['label' => __('Refund'), 'class' => 'profit'], default => ['label' => __(ucfirst($transaction->type)), 'class' => 'charge'], }; @endphp {{ $typeBadge['label'] }} {{-- --}} {{-- --}} {{-- @lang($transaction->status)--}} {{-- --}} {{$transaction->details ?? __('N/A')}} @php $statusBadge = match($transaction->status) { 'pending' => ['label' => __('Pending'), 'class' => 'status-pending'], 'success' => ['label' => __('Success'), 'class' => 'status-success'], 'failed' => ['label' => __('Failed'), 'class' => 'status-failed'], 'cancelled' => ['label' => __('Cancelled'), 'class' => 'status-cancelled'], default => ['label' => __(ucfirst($transaction->status)), 'class' => 'status-default'], }; @endphp {{ $statusBadge['label'] }} @php $hasStatusTimestampUpdate = $transaction->updated_at && $transaction->updated_at->ne($transaction->created_at); $createdFormatted = \Carbon\Carbon::parse($transaction->created_at)->locale(app()->getLocale())->translatedFormat('d F Y h:i A'); $updatedFormatted = $hasStatusTimestampUpdate ? \Carbon\Carbon::parse($transaction->updated_at)->locale(app()->getLocale())->translatedFormat('d F Y h:i A') : null; @endphp @if($hasStatusTimestampUpdate) {{ $updatedFormatted }} @else {{ $createdFormatted }} @endif @php $canShowChargeInvoice = $transaction->type === \App\Models\Payment::TYPE_CHARGE && $transaction->status === \App\Models\Payment::STATUS_SUCCESS; @endphp @if($canShowChargeInvoice) إيصال @endif {{-- TODO: قد نحتاجه لاحقاً — فاتورة سترايب الأصلية @php $canShowStripeReceipt = $transaction->type === \App\Models\Payment::TYPE_CHARGE && $transaction->payment_method === \App\Models\Payment::PAYMENT_METHOD_STRIPE && $transaction->status === \App\Models\Payment::STATUS_SUCCESS && !empty($transaction->transaction_id); @endphp @if($canShowStripeReceipt) إيصال Stripe @endif --}}
@lang('No Items Found')
@if($transactions->hasPages())
{{ $transactions->withQueryString()->links('front.pagination') }}
@endif

@lang('Summary')

@lang('Total Profit')
{{$amountTotalEarn}} $
@lang('time')
{{time_calc($user->created_at)}}
@lang('Withdrawal Transactions')
{{$totalTransactions}} @lang('Transaction')
@endsection @section('js-body') @endsection