src/routes/(auth)/+page.svelte (view raw)
1<script lang="ts">
2 import { db } from '$lib/db';
3 import { liveQuery } from 'dexie';
4 import NewTask from './NewTask.svelte';
5 import Task from './Task.svelte';
6 import { getStringNoLocale } from '@inrupt/solid-client';
7 import { SCHEMA_INRUPT } from '@inrupt/vocab-common-rdf';
8 import type { PageData } from './$types';
9
10 let { data }: { data: PageData } = $props();
11 let tasks = liveQuery(() => db.tasks.toArray());
12</script>
13
14<div class="flex flex-col gap-4 py-4">
15 {#each $tasks as task (task.id)}
16 <Task {task} />
17 {:else}
18 <p class="text-center">Aucune tâche actuellement</p>
19 {/each}
20</div>
21
22<ul>
23 {#each data.taskSubjects as taskSubject}
24 <li>{getStringNoLocale(taskSubject, SCHEMA_INRUPT.name)}</li>
25 {/each}
26</ul>
27
28<NewTask />