@props(['state' => 'scheduled'])

{{-- How soon this package can be handed over.

     One component for both readers — the public price sheet and the customer's
     own overview — because the promise is the same promise, and a visitor who
     reads "wird sofort ausgeliefert" before paying must not find a different
     sentence on the page they land on afterwards. The state is derived from the
     estate (HostCapacity::deliveryFor); nothing here decides anything.

     No duration on the immediate branch on purpose: "in 20 Minuten" is a
     promise about a machine we do not control. It is ready when it is ready,
     and the customer is told by mail. The two to three working days on the
     other branch is a promise about US — the time it takes to buy, rack and
     onboard a server — and that one we can keep. --}}
@php
    $immediate = $state === 'immediate';
@endphp

{{-- One line, guaranteed. In a four-column price sheet the wording had a
     column 202px wide to live in and broke over two lines, which put the icon
     beside the first half of a sentence and the rest under it — the shape R18
     exists to prevent. The wording is short enough to fit now, and
     whitespace-nowrap makes that a property of the component rather than a
     coincidence of the current translation. --}}
<p {{ $attributes->class(['flex items-center gap-2 whitespace-nowrap text-xs font-medium']) }}>
    <x-ui.icon :name="$immediate ? 'check' : 'calendar'"
               @class(['size-4 shrink-0', 'text-success' => $immediate, 'text-muted' => ! $immediate]) />
    <span @class(['text-success' => $immediate, 'text-muted' => ! $immediate])>
        {{ __('delivery.'.($immediate ? 'immediate' : 'scheduled')) }}
    </span>
</p>
