+
+ {#if skeleton}
+
+
+
+
+
+
+ {#each Array(numCellsInRow) as _, index (index)}
+
+
+
+ {/each}
+
+
+
+
+
+ {:else}
+
+
+ navigate(-(numCellsInRow - 1))} />
+ navigate(-1)} />
+
+
+ {#each displayedDates as date (date.toString())}
+
+ {/each}
+
+
+ navigate(1)} />
+ navigate(numCellsInRow - 1)} />
+
+ {/if}
+
+
+ {#if skeleton}
+
+ {#each Array(3) as _, habitIndex (habitIndex)}
+
+
+
+
+
+
+ {#if habitIndex === 0}
+
+ {#each Array(numCellsInRow) as _, cellIndex (cellIndex)}
+
+
+
+ {/each}
+ {:else if habitIndex === 1}
+
+ {#each Array(Math.floor(numCellsInRow / 3)) as _, periodIndex (periodIndex)}
+
+
+
+ {/each}
+
+ {#if numCellsInRow % 3 !== 0}
+
+
+
+ {/if}
+ {:else}
+
+ {#each Array(Math.floor(numCellsInRow / 2)) as _, periodIndex (periodIndex)}
+
+
+
+ {/each}
+
+ {#if numCellsInRow % 2 !== 0}
+
+
+
+ {/if}
+ {/if}
+
+
+
+ {/each}
+ {:else}
+
+ {#each displayedHabits as habit (habit.id)}
+
+
+
+
+
+
+
+ {habit.name}
+
+
+
+ {#each createHabitCells(habit, displayedDates, numCellsInRow) as cell (`${habit.id}-${cell.date}-${cell.gridColumn}`)}
+
+ {#if cell.isEmpty}
+
+ {:else}
+
{ await habitService.resetPeriodByDates(habit.id, cell.periodDates); }}
+ onSetValue={(totalValue, dailyValues) => habitService.setPeriodValue(habit.id, cell.periodDates, totalValue, dailyValues)}
+ onToggleFailed={() => habitService.togglePeriodFailed(habit.id, cell.periodDates, cell.isFailed)}
+ >
+
+
+ {/if}
+
+ {/each}
+
+
+
+ {/each}
+ {/if}
+