CluPilotCloud/resources/views/livewire/confirm-withdraw.blade.php

47 lines
2.3 KiB
PHP

@php
$eur = fn (int $cents) => \Illuminate\Support\Number::currency($cents / 100, in: 'EUR', locale: app()->getLocale());
@endphp
<div class="rounded-lg bg-surface p-6">
<div class="flex items-start gap-3">
<span class="grid size-10 shrink-0 place-items-center rounded-lg bg-warning-bg text-warning">
<x-ui.icon name="alert-triangle" class="size-5" />
</span>
<div class="min-w-0">
<h3 class="text-base font-semibold text-ink">{{ __('withdrawal.confirm_title') }}</h3>
<p class="mt-1 text-sm text-muted">{{ __('withdrawal.confirm_body') }}</p>
</div>
</div>
<ul class="mt-4 space-y-1.5 text-sm text-body">
<li class="flex items-start gap-2">
<x-ui.icon name="alert-triangle" class="mt-0.5 size-4 shrink-0 text-warning" />{{ __('withdrawal.confirm_point_now') }}
</li>
<li class="flex items-start gap-2">
<x-ui.icon name="check" class="mt-0.5 size-4 shrink-0 text-muted" />{{ __('withdrawal.confirm_point_documents') }}
</li>
{{-- The pro-rata share, stated before the button and not after it.
FAGG §16 lets us keep it only because the customer asked for the
service to start at once and was told this would follow so this
is where they are told it again, with the actual figure. Where no
such request was recorded the amount is zero and the sentence says
the whole amount comes back. --}}
<li class="flex items-start gap-2">
<x-ui.icon name="receipt" class="mt-0.5 size-4 shrink-0 text-muted" />
{{ $owedNetCents > 0
? __('withdrawal.confirm_point_prorata', [
'amount' => $eur($owedNetCents),
'days' => $deliveredDays,
'term' => $termDays,
])
: __('withdrawal.confirm_point_full') }}
</li>
</ul>
<div class="mt-6 flex justify-end gap-3">
<x-ui.button variant="secondary" x-on:click="Livewire.dispatch('closeModal')">{{ __('withdrawal.keep') }}</x-ui.button>
<x-ui.button variant="danger" wire:click="proceed" wire:loading.attr="disabled">
{{ __('withdrawal.confirm') }}
</x-ui.button>
</div>
</div>