@extends('layouts.app')
@section('title', 'Trust Score')
@push('styles')
@endpush
@section('content')
@php
// Score is 0-100 from the controller
$pct = max(0, min(100, (int) $score));
$scoreColor = $pct >= 70 ? 'green' : ($pct >= 40 ? 'yellow' : 'red');
$circumference = 2 * 3.14159 * 76;
$offset = $circumference - ($pct / 100) * $circumference;
$colorMap = [
'success' => ['bg' => 'var(--success-light, rgba(16,185,129,0.12))', 'fg' => 'var(--success)'],
'warning' => ['bg' => 'var(--warning-light, rgba(245,158,11,0.12))', 'fg' => 'var(--warning)'],
'danger' => ['bg' => 'var(--danger-light, rgba(239,68,68,0.12))', 'fg' => 'var(--danger)'],
'accent' => ['bg' => 'var(--accent-light, rgba(99,102,241,0.12))', 'fg' => 'var(--accent)'],
];
@endphp
Trust Score
{{-- Score Hero --}}
{{ $pct }}/{{ $scoreMax }}
Your Trust Score
{{-- Stats --}}
{{ $totalTxns }}
Total Transactions
{{ $completedTxns }}
Successful Transactions
{{ number_format($averageRating, 1) }}
Average Rating ({{ $reviewCount }})
{{-- Breakdown --}}
@foreach($breakdown as $row)
@php $c = $colorMap[$row['color']] ?? $colorMap['accent']; @endphp
{{ $row['label'] }}
{{ $row['value'] }}
{{ $row['contribution'] >= 0 ? '+' : '' }}{{ $row['contribution'] }} pts
@endforeach
Completion Rate
{{ $completionRate }}%
Share of your transactions that completed successfully.
{{-- How to Improve --}}
- Complete your identity verification to boost credibility.
- Maintain a high transaction completion rate by fulfilling all escrow agreements.
- Respond quickly to messages and transaction requests.
- Resolve disputes amicably to keep your dispute rate low.
- Ask satisfied counterparties to leave positive reviews.
{{-- Recent Reviews --}}
@forelse($reviews as $review)
{{ $review->reviewer_name }}
{{ $review->created_at?->format('M d, Y') }}
@for($i = 1; $i <= 5; $i++)
@endfor
@empty
No reviews yet. Completing transactions and requesting feedback from counterparties will populate this list.
@endforelse
@endsection