{locationToEdit ? $t('adventures.edit_location') : $t('adventures.new_location')}

{locationToEdit ? $t('adventures.update_location_details') : $t('adventures.create_new_location')}

    {#each steps as step, index}
  • {#if index > 0}
    {/if}
    {#if index < steps.length - 1}
    {/if}
  • {/each}
{#if !location.id} {:else} {/if}
{#if steps[0].selected} { location.name = e.detail.name; location.location = e.detail.location; location.latitude = e.detail.latitude; location.longitude = e.detail.longitude; steps[0].selected = false; steps[1].selected = true; }} on:cancel={() => close()} on:next={() => { steps[0].selected = false; steps[1].selected = true; }} /> {/if} {#if steps[1].selected} { steps[1].selected = false; steps[0].selected = true; }} on:save={(e) => { location.name = e.detail.name; location.category = e.detail.category; location.rating = e.detail.rating; location.is_public = e.detail.is_public; location.link = e.detail.link; location.description = e.detail.description; location.latitude = e.detail.latitude; location.longitude = e.detail.longitude; location.location = e.detail.location; location.tags = e.detail.tags; location.user = e.detail.user; location.id = e.detail.id; steps[1].selected = false; steps[2].selected = true; }} /> {/if} {#if steps[2].selected} { steps[2].selected = false; steps[1].selected = true; }} itemId={location.id} on:next={() => { steps[2].selected = false; steps[3].selected = true; }} measurementSystem={user?.measurement_system || 'metric'} /> {/if} {#if steps[3].selected} { steps[3].selected = false; steps[2].selected = true; }} on:close={() => close()} measurementSystem={user?.measurement_system || 'metric'} {collection} /> {/if}