{#if combinedData && combinedData.length > 0}
{#each boxNumbers as boxNumber}

Box {boxNumber}

{#each combinedData as { pokedexEntry, catchRecord }} {@const placement = showForms ? pokedexEntry.boxPlacementForms : pokedexEntry.boxPlacement} {#if placement.box === boxNumber}
{#if catchRecord?.inHome} {/if}
{pokedexEntry.pokemon} {pokedexEntry.form ? `(${pokedexEntry.form})` : ''}
{pokedexEntry.pokedexNumber.toString().padStart(3, '0')}
Caught: {catchRecord?.caught ? 'Yes' : 'No'}
Needs to Evolve: {catchRecord?.haveToEvolve ? 'Yes' : 'No'}
In Home: {catchRecord?.inHome ? 'Yes' : 'No'}
{/if} {/each}
{/each}
{:else if failedToLoad} {#if creatingRecords && totalRecordsCreated > 0}

Processed {totalRecordsCreated} Pokédex entries so far...

Please be patient, this may take some time.

{:else if creatingRecords}

Processing...

Please be patient, this may take some time.

{:else}

Failed to load

If you're seeing this, you probably haven't created your Pokédex data yet. Please do so by clicking this button.

{/if} {:else}

Loading Pokédex

{/if}