@php
$primary = $setting?->primary_color ?: '#124a61';
$accent = $setting?->accent_color ?: '#2e86ab';
$company = $setting?->company_name ?: config('app.name');
$logo = $setting?->logoSrc();
$qty = fn ($v) => rtrim(rtrim(number_format((float) $v, 2), '0'), '.');
$deadline = $rfq->response_deadline;
// One place decides what this page is: a live advert, or a notice explaining
// why it is no longer one.
$mode = match (true) {
$rfq->status === 'cancelled' => 'cancelled',
$rfq->status === 'awarded' => 'awarded',
$rfq->status === 'draft' => 'notyet',
// Still running, but the buyer has taken it back to invite-only. The
// advertised link keeps working; it just no longer admits new bidders.
! $rfq->is_public && ! $rfq->is_expired && $rfq->status === 'sent' => 'invitesonly',
! $isOpen => 'closed',
$registering => 'registering',
default => 'advert',
};
@endphp
{{ $deadline ? $deadline->format('j M Y, H:i') : __('Open-ended') }}
@if ($rfq->required_by)
{{ __('Required by') }}
{{ $rfq->required_by->format('j M Y') }}
@endif
{{ __('Bidders so far') }}
{{ $bidCount }}
{{-- ============================ NOTICES =========================== --}}
@if (in_array($mode, ['cancelled', 'awarded', 'closed', 'notyet', 'invitesonly'], true))
@php
$notice = match ($mode) {
'cancelled' => ['title' => __('This tender has been withdrawn'), 'body' => __('The buyer cancelled this request. Nothing further is needed.')],
'awarded' => ['title' => __('This tender has been awarded'), 'body' => __('A supplier has been selected and the tender is closed. Thank you to everyone who quoted.')],
'notyet' => ['title' => __('This tender is not open yet'), 'body' => __('It has not been issued. Please check back, or contact the buyer using the details below.')],
'invitesonly' => ['title' => __('This tender is by invitation only'), 'body' => __('It is no longer open for general registration. Contact the buyer below if you would like to be invited.')],
default => ['title' => __('This tender has closed'), 'body' => __('The deadline has passed and new bids can no longer be accepted. If you already quoted, your submission still stands.')],
};
@endphp
{{ $notice['title'] }}
{{ $notice['body'] }}
@if ($mode === 'closed')
{{ __('Already bidding? Open the private link that was emailed to you to review your quotation.') }}
{{ __('Tell us who you are and we will take you straight to the pricing form. No account, no password — your details are used only for this tender.') }}
@error('company_name')
{{ $message }}
@enderror
@error('contact_name')
{{ $message }}
@enderror
@error('phone')
{{ $message }}
@enderror
{{ __('Your private bidding link is tied to this address. Use the same one if you come back to revise.') }}