chore: flatten repo
All checks were successful
build / build (push) Successful in 47s
build / deploy (push) Successful in 17s

This commit is contained in:
2026-08-26 03:57:15 +00:00
parent b02a07d3bd
commit cb5fc9d095
85 changed files with 22 additions and 23 deletions

View File

@@ -0,0 +1,20 @@
import { db } from '$lib/db';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async () => {
const topics = await db.query.topics.findMany({
with: {
topicsToTasks: {
with: {
task: true
}
}
}
});
topics.sort((a, b) => b.topicsToTasks.length - a.topicsToTasks.length);
return {
topics
};
};

View File

@@ -0,0 +1,29 @@
<script lang="ts">
import { goto } from '$app/navigation';
import * as Table from '$lib/components/ui/table/index.js';
let { data } = $props();
</script>
<Table.Root>
<Table.Header>
<Table.Row>
<Table.Head class="w-[100px]">Name</Table.Head>
<Table.Head>Amount of Tasks</Table.Head>
<Table.Head class="text-right">Actions</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{#each data.topics as topic}
<Table.Row
onclick={() => goto(`/progress/topics/${topic.id}`)}
class="cursor-pointer hover:bg-muted/50"
>
<Table.Cell class="font-medium">{topic.name}</Table.Cell>
<Table.Cell>{topic.topicsToTasks.length}</Table.Cell>
<Table.Cell class="text-right"></Table.Cell>
</Table.Row>
{/each}
</Table.Body>
</Table.Root>

View File

@@ -0,0 +1,18 @@
import { db } from '$lib/db';
import { topics } from '$lib/db/schema';
import { eq } from 'drizzle-orm';
export const load = async ({ params }) => {
return {
topic: await db.query.topics.findFirst({
with: {
topicsToTasks: {
with: {
task: true
}
}
},
where: eq(topics.id, params.id)
})
};
};

View File

@@ -0,0 +1,14 @@
<script lang="ts">
let { data } = $props();
</script>
<h1 class="my-4 text-2xl font-bold text-center">{data.topic.name}</h1>
<h2 class="text-xl font-bold">Tasks ({data.topic?.topicsToTasks.length})</h2>
{#each data.topic?.topicsToTasks as task}
<div class="flex gap-4 items-center relative">
<a href="/progress/{task.task.id}" class="text-lg font-semibold hover:underline"
>{task.task.name}</a
>
</div>
{/each}