feat: add total points

This commit is contained in:
2025-02-13 22:17:16 +01:00
parent 0903476323
commit 2462ab66fe

View File

@@ -3,17 +3,20 @@
</script> </script>
<div class="flex flex-col items-center p-4"> <div class="flex flex-col items-center p-4">
<div class="w-full max-w-4xl flex justify-center gap-8 items-center mt-4 mb-8"> <div class="w-full max-w-4xl flex flex-col gap-4 items-center mt-4 mb-8">
<h1 class="font-bold text-2xl"> <div class="flex justify-center gap-8">
Tasks ({data.tasks.length}) <h1 class="font-bold text-2xl">
</h1> Tasks ({data.tasks.length})
{#if data.editable} </h1>
<a href="/progress/create"> {#if data.editable}
<button class="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600 transition"> <a href="/progress/create">
Create <button class="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600 transition">
</button> Create
</a> </button>
{/if} </a>
{/if}
</div>
Total progress: {data.tasks.reduce((acc, task) => acc + task.currentPoints, 0)}
</div> </div>
{#if data.tasks.length > 0} {#if data.tasks.length > 0}