<%- include('partials/header') %>
<%= t('tech.dashboard.greeting', 'Halo, Selamat Bekerja!') %>
<%= techName %>
<%= t('tech.dashboard.in_progress', 'Sedang Dikerjakan') %>
<%= stats.inProgress %>
<%= t('tech.dashboard.resolved_today', 'Selesai Hari Ini') %>
<%= stats.resolved %>
<%= t('tech.dashboard.active_tasks', 'Tugas Aktif Anda') %> (<%= tickets.length %>)
<% if (tickets.length === 0) { %>

<%= t('tech.dashboard.empty_active', 'Bagus! Tidak ada tugas aktif saat ini.') %>
<%= t('tech.dashboard.empty_active_hint', 'Silakan cek tab "Tiket Baru" untuk mengambil tugas.') %>

<% } else { %> <% tickets.forEach(function(ticket){ %>
<% var statusLabel = ticket.status; if (ticket.status === 'open') statusLabel = t('tech.ticket.open', 'Belum Ditangani'); if (ticket.status === 'in_progress') statusLabel = t('tech.ticket.in_progress', 'Sedang Dikerjakan'); if (ticket.status === 'resolved') statusLabel = t('tech.ticket.resolved', 'Selesai'); %> <% if (ticket.status === 'in_progress') { %><% } %> <%= statusLabel %> <%= typeof formatTimeLocal === 'function' ? formatTimeLocal(ticket.created_at) : (ticket.created_at ? new Date(ticket.created_at).toLocaleTimeString('id-ID', {hour:'2-digit', minute:'2-digit'}) : '-') %>
<%= ticket.customer_name %>
<%= ticket.customer_address || t('tech.ticket.no_address', 'Tidak ada alamat') %>
<%= ticket.customer_phone || '-' %>
<%= ticket.subject %>
<%= ticket.message %>
<% if (ticket.customer_photos && ticket.customer_photos !== '' && ticket.customer_photos !== '[]') { %> <% var customerPhotos = JSON.parse(ticket.customer_photos || '[]'); %> <% if (customerPhotos.length > 0) { %>
<%= t('tech.cust_photos','Foto dari pelanggan') %><%= customerPhotos.length %>)
<% customerPhotos.slice(0,3).forEach(function(photo){ %> Foto <% }); %>
<% if (customerPhotos.length > 3) { %>
+<%= customerPhotos.length - 3 %> <%= t('tech.more_photos_suffix','foto lainnya') %>
<% } %>
<% } %> <% } %>

<%= t('tech.ticket.resolve_title', 'Selesaikan Tugas') %>

<%= t('tech.task_for','Tugas untuk') %> <%= ticket.customer_name %> — <%= ticket.subject %>
<%= t('tech.job_note_hint','Catatan ini akan dilihat admin dan pelanggan.') %>
<%= t('tech.job_photos_hint','Foto sebelum/sesudah, perangkat, atau signal level. Max 5MB/foto.') %>
<%= t('tech.gps_note','Lokasi GPS otomatis tersimpan saat menyelesaikan tugas.') %>
<% }); %> <% } %> <%- include('partials/bottom_nav') %>