{$tickets.currentTicket ? `Ticket: ${$tickets.currentTicket.title}` : 'Cargando...'} - ServiceManager
{#if $tickets.isLoading}

Cargando ticket...

{:else if $tickets.error}

Error al cargar ticket

{$tickets.error}

{:else if $tickets.currentTicket}
Mis Tickets #{$tickets.currentTicket.id.substring(0, 8)}

{$tickets.currentTicket.title}

{statusConfig[$tickets.currentTicket.status].label} {priorityConfig[$tickets.currentTicket.priority].label} Creado {formatDate($tickets.currentTicket.created_at)}
{#if canClose} {/if}

{$tickets.currentTicket.description}

{#if $tickets.currentTicket.resolution}

Resolución:

{$tickets.currentTicket.resolution}

{/if}
{#if $tickets.attachments.length > 0}

Archivos Adjuntos {$tickets.attachments.length} archivo{$tickets.attachments.length !== 1 ? 's' : ''}

{#if showAttachments}
{#each $tickets.attachments as attachment}

{attachment.original_filename}

{Math.round(attachment.size_bytes / 1024)} KB • Subido por {attachment.uploaded_by_name} • {formatDate(attachment.uploaded_at)}

{/each}
{/if}
{/if}

Conversación

{#if $tickets.comments.length === 0}

No hay comentarios aún. ¡Sé el primero en comentar!

{:else}
{#each $tickets.comments as comment} {console.log('Comment:', comment)}
{comment.author_name ? comment.author_name .split(' ') .map(n => n[0]) .join('') : '??'}
{comment.author_name} {formatDate(comment.created_at)} {#if comment.is_internal} Interno {/if}

{comment.content}

{/each}
{/if}