<x-layouts.app :title="__('serp_checks.details').' — TrafficPumper'"><x-customer-shell><nav><ol class="breadcrumb"><li class="breadcrumb-item"><a href="{{route('serp-checks.index')}}">{{__('serp_checks.title')}}</a></li><li class="breadcrumb-item active">{{$check->phrase}}</li></ol></nav><header class="tp-page-header"><div><p>{{$check->keyword->project->name}} · {{$check->keyword->project->domain}}</p><h1>{{__('serp_checks.details')}}</h1><span>{{$check->status->label()}}</span></div></header><section class="tp-metric-grid tp-serp-metrics"><x-metric-card :label="__('serp_checks.rank')" :value="$rank?'#'.$rank:($check->status===\App\Enums\SerpCheckStatus::Completed?'100+':null)" icon="◎"/><x-metric-card :label="__('serp_checks.previous')" :value="$previous?'#'.$previous:null" icon="◷"/><x-metric-card :label="__('serp_checks.change')" :value="$change" icon="↕"/><x-metric-card :label="__('serp_checks.status')" :value="$check->status->label()" icon="●"/><x-metric-card :label="__('serp_checks.type')" :value="__('serp_checks.'.($check->origin==='scheduled'?'scheduled':'manual'))" icon="⌁"/><x-metric-card :label="__('serp_checks.completed_at')" :value="$check->completed_at?->diffForHumans()" icon="✓"/></section><div class="tp-two-columns"><section class="tp-panel"><dl class="tp-detail-list"><div><dt>{{__('serp_checks.keyword')}}</dt><dd>{{$check->phrase}}</dd></div><div><dt>{{__('serp_checks.engine')}}</dt><dd>{{$check->search_engine->label()}}</dd></div><div><dt>{{__('serp_checks.target')}}</dt><dd>{{$check->country_code}} / {{$check->language_code}} / {{$check->device->label()}}</dd></div><div><dt>{{__('serp_checks.requested')}}</dt><dd>{{$check->created_at->translatedFormat('d M Y H:i')}}</dd></div><div><dt>{{__('serp_checks.started')}}</dt><dd>{{$check->started_at?->translatedFormat('d M Y H:i')??'—'}}</dd></div><div><dt>{{__('serp_checks.found_url')}}</dt><dd>{{$check->results->firstWhere('is_project_domain',true)?->url??'—'}}</dd></div>@if($check->status===\App\Enums\SerpCheckStatus::Failed)<div><dt>{{__('serp_checks.safe_error')}}</dt><dd>{{__('serp_checks.error.'.(in_array($check->error_code,['validation','timeout'],true)?$check->error_code:'failed'))}}</dd></div>@endif</dl></section><section class="tp-panel"><div class="tp-panel-heading"><h2>{{__('serp_checks.organic')}}</h2></div><div class="table-responsive"><table class="table tp-data-table"><thead><tr><th>{{__('serp_checks.result_rank')}}</th><th>{{__('serp_checks.title_col')}}</th><th>{{__('serp_checks.url')}}</th><th>{{__('serp_checks.ours')}}</th></tr></thead><tbody>@forelse($check->results as $result)<tr><td>#{{$result->position}}</td><td>{{$result->title}}</td><td>@if(in_array(parse_url($result->url,PHP_URL_SCHEME),['http','https'],true))<a href="{{$result->url}}" rel="noopener noreferrer">{{$result->display_url?:parse_url($result->url,PHP_URL_HOST)}}</a>@else{{$result->display_url}}@endif</td><td>{{$result->is_project_domain?__('serp_checks.yes'):__('serp_checks.no')}}</td></tr>@empty<tr><td colspan="4">{{__('serp_checks.no_checks')}}</td></tr>@endforelse</tbody></table></div></section></div></x-customer-shell></x-layouts.app>
