@props(['form', 'tone' => 'dark', 'defaults' => [], 'product' => null, 'ctaLabel' => null, 'action' => null, 'showHeader' => true]) @php $layout = app(\App\Support\Storefront\FormLayout::class); $defaults = collect($defaults); if ($product) { $defaults->put('product', $defaults->get('product') ?: $product->title); if (blank($defaults->get('details'))) { $defaults->put('details', 'Interested in custom branding for '.$product->title.'.'); } if (blank($defaults->get('grade')) && $product->grade) { $defaults->put('grade', $product->grade); } } if ($form) { $isNewsletter = $form->title === 'Newsletter' || $form->handle === 'newsletter'; $isQuote = $product || in_array($form->handle, ['rfq', 'inline-quote'], true); $isContact = $form->handle === 'contact'; $steps = $layout->steps($form->fields, (bool) $form->multi_step); $stepCount = count($steps); $prefix = 'tf-'.$form->handle; $eyebrow = match (true) { $isNewsletter => 'Stay close', $isQuote => 'Custom branded quote', $isContact => 'Get in touch', default => config('app.name'), }; $badgeIcon = match (true) { $isNewsletter => 'mail-plus', $isQuote => 'pen-tool', $isContact => 'messages-square', default => 'clipboard-list', }; $subtitle = $form->description ?: match (true) { $isNewsletter => 'New canvas drops, event offers and care tips. No spam, unsubscribe anytime.', $isQuote => 'Tell us about your ring and your brand. We reply with pricing, lead time and a mockup plan.', $isContact => 'Sizing, freight or an order question — we usually reply the same business day.', default => null, }; $submitLabel = $isNewsletter ? 'Subscribe' : ($ctaLabel ?: 'Submit request'); $valueFor = fn ($field) => old($field->name, $defaults->get($field->name)); } @endphp @if($form)
@endif