@extends('layouts.app') @section('title', ($training->title ?? 'Treinamento') . ' - GIGAX ARENA') @section('page_title', 'Treinamento') @section('content') @php $status = $training->user_status ?? 'available'; $statusLabel = $status === 'completed' ? 'Concluído' : ($status === 'in_progress' ? 'Em andamento' : 'Disponível'); $videoId = null; $videoProvider = null; if (!empty($training->video_url)) { if (preg_match('/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([^&?\/]+)/', $training->video_url, $matches)) { $videoId = $matches[1] ?? null; $videoProvider = 'youtube'; } elseif (preg_match('/vimeo\.com\/(\d+)/', $training->video_url, $matches)) { $videoId = $matches[1] ?? null; $videoProvider = 'vimeo'; } } @endphp
← Voltar aos treinamentos {{ $statusLabel }}

{{ $training->title }}

{{ $training->description ?? 'Treinamento competitivo GIGAX.' }}

🎯 {{ ucfirst(str_replace('_', ' ', $training->type ?? 'treino')) }} ⭐ {{ ucfirst($training->level ?? 'beginner') }} ⏱ {{ (int) ($training->duration_minutes ?? 0) }} minutos 👤 {{ $training->created_by_name ?? 'GIGAX' }}
◎
@if(!empty($training->video_url))

Vídeo do treinamento

@if($videoProvider === 'youtube' && $videoId) @elseif($videoProvider === 'vimeo' && $videoId) @else ▶ Abrir vídeo do treinamento @endif
@endif

Guia de execução

{!! nl2br(e($training->guide_text ?? 'Siga as instruções do treinador, execute o exercício e registre sua conclusão ao final.')) !!}
@if($status === 'completed')
RESULTADO REGISTRADO {{ (int) ($training->user_score ?? 0) }}% @if(!empty($training->user_completed_at)) Concluído em {{ \Illuminate\Support\Carbon::parse($training->user_completed_at)->format('d/m/Y H:i') }} @endif
@else
FINALIZAÇÃO

Concluiu este treinamento?

Registre a conclusão para atualizar seu histórico e sua pontuação.

@endif
@endsection @push('styles') @endpush @if($status !== 'completed') @push('scripts') @endpush @endif