@extends('layouts.main') @section('title', 'My Product Inquiries') @section('content')

Penawaran Produk Saya

Riwayat penawaran dan pertanyaan produk

@forelse($inquiries as $inquiry)
No. {{ $loop->iteration + $inquiries->firstItem() - 1 }} {{ $inquiry->name }}
Detail
@if($inquiry->product)
@if($inquiry->product->product_image) {{ $inquiry->product->product_title }} @endif

Produk

{{ $inquiry->product->product_title ?? 'N/A' }}

@endif

Pesan

@php $raw = $inquiry->message ?? ''; $lines = preg_split("/(\r\n|\n|\r)/", $raw); $type = null; $hasAddonsLine = false; if (!empty($lines)) { $first = $lines[0] ?? ''; $second = $lines[1] ?? ''; if (substr($first, 0, 14) === '[REQUEST_TYPE]') { $type = trim(substr($first, 14)); } if (substr($second, 0, 8) === '[ADDONS]') { $hasAddonsLine = true; } } $startIdx = 0; if ($type) { $startIdx++; } if ($hasAddonsLine) { $startIdx++; } if (!empty($lines) && isset($lines[$startIdx]) && trim($lines[$startIdx]) === '') { $startIdx++; } $plain = implode("\n", array_slice($lines, $startIdx)); $badgeText = $type === 'custom_addon' ? 'Custom Add-on' : ($type === 'custom_new' ? 'Custom Baru' : ($type ? 'Katalog' : null)); $badgeCls = $type === 'custom_addon' ? 'bg-yellow-100 text-yellow-800' : ($type === 'custom_new' ? 'bg-red-100 text-red-800' : 'bg-blue-100 text-blue-800'); @endphp
@if($badgeText) {{ $badgeText }} @endif

{{ Str::limit($plain ?: $inquiry->message, 80) }}

Status

@if($inquiry->is_read) Dibaca @else Belum Dibaca @endif

Tanggal

{{ $inquiry->created_at->format('d M Y') }}

@empty

Belum ada penawaran produk

Mulai dengan melihat produk kami

Lihat Produk
@endforelse
@if($inquiries->count() > 0)
{{ $inquiries->links() }}
@endif
@endsection