{#if (trail.public || trailIsShared) && pb.authStore.model}
{#if trail.public && pb.authStore.model} {/if} {#if trailIsShared} {/if}
{/if}

{trail.name}

{#if trail.date}
{new Date(trail.date).toLocaleDateString( undefined, { month: "long", day: "2-digit", year: "numeric", timeZone: "UTC", }, )}
{/if} {#if trail.expand?.author}

{$_("by")} avatar {#if !trail.expand.author.private} {trail.expand.author.username} {:else} {trail.expand.author.username} {/if}

{/if}
{#if trail.location}

{trail.location}

{/if}

{$_(trail.difficulty ?? "?")}

{#if ($currentUser && $currentUser.id == trail.author) || trail.expand?.trail_share_via_trail?.length || trail.public} {/if}
{#if mode == "overview"}
{$_("distance")} {formatDistance(trail.distance)}
{$_("est-duration")} {formatTimeHHMM(trail.duration)}
{$_("elevation-gain")} {formatElevation(trail.elevation_gain)}
{$_("elevation-loss")} {formatElevation(trail.elevation_loss)}
{#if trail.expand?.category}
{$_("category")} {$_(trail.expand.category.name)}
{/if}
{/if} {#if trail.tags && trail.tags.length > 0}
{#each trail.tags as tag} {tag} {/each}

{/if}
{#if activeTab == 0}
{trail.description}
{/if} {#if activeTab == 1}
    {#each trail.expand?.waypoints ?? [] as waypoint, i}
  • openMarkerPopup(i)} on:mouseleave={() => closeMarkerPopup(i)} >
  • {/each}
{/if} {#if activeTab == 2} {/if} {#if activeTab == 3}
{/if} {#if activeTab == 4}
{#if $currentUser}
avatar
{/if}
    {#each $comments ?? [] as comment}
  • deleteComment(e.detail)} on:edit={(e) => editComment(e.detail)} >
  • {/each}
{/if} {#if mode == "overview"}
{/if}