diff --git a/frontend/src/lib/components/admin/table/Table.svelte b/frontend/src/lib/components/admin/table/Table.svelte
new file mode 100644
index 0000000..97755b7
--- /dev/null
+++ b/frontend/src/lib/components/admin/table/Table.svelte
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+ | Ev. č. přihlásky |
+ Jméno |
+ Příjmení |
+ Obor |
+ |
+
+
+
+ {#each candidates as candidate}
+
+ | {candidate.applicationId} |
+
+ {candidate.name}
+ |
+
+ {candidate.surname}
+ |
+
+ {candidate.study}
+ |
+
+
+ |
+
+ {/each}
+
+
+
+
+
+
+
+
diff --git a/frontend/src/lib/components/button/Delete.svelte b/frontend/src/lib/components/button/Delete.svelte
index 1e49128..ae1f330 100644
--- a/frontend/src/lib/components/button/Delete.svelte
+++ b/frontend/src/lib/components/button/Delete.svelte
@@ -5,14 +5,19 @@
export let value: string;
- let isPrepared = false;
+ export let id: number | undefined;
+ let isPrepared = false;
const buttonLogic = () => {
if (isPrepared) {
- dispatch('delete');
+ dispatch('delete', {
+ id: id
+ });
} else {
- dispatch('prepared');
+ dispatch('prepared', {
+ id: id
+ });
isPrepared = true;
setTimeout(() => {
isPrepared = false;
@@ -44,9 +49,8 @@
button {
@apply inline-flex items-center;
@apply bg-red-700;
- @apply @apply rounded-lg p-3 text-xl font-semibold
+ @apply @apply rounded-lg p-3 font-semibold
text-white transition-colors duration-300;
- @apply w-full;
animation: none !important;
}
diff --git a/frontend/src/routes/(admin)/admin/(authenticated)/dashboard/+page.svelte b/frontend/src/routes/(admin)/admin/(authenticated)/dashboard/+page.svelte
index f2e18b4..c50249c 100644
--- a/frontend/src/routes/(admin)/admin/(authenticated)/dashboard/+page.svelte
+++ b/frontend/src/routes/(admin)/admin/(authenticated)/dashboard/+page.svelte
@@ -7,6 +7,7 @@
import Fuse from 'fuse.js';
import type { PageServerData } from './$types';
import Delete from '$lib/components/button/Delete.svelte';
+ import Table from '$lib/components/admin/table/Table.svelte';
export let data: PageServerData;
@@ -112,58 +113,7 @@
{/if}
-
-
-
-
-
-
-
- |
- Ev. č. přihlásky
- |
- Jméno |
-
- Příjmení
- |
- Obor |
- |
-
-
-
- {#each candidatesTable as candidate}
-
- | {candidate.applicationId} |
-
- {candidate.name}
- |
-
- {candidate.surname}
- |
-
- {candidate.study}
- |
-
- await deleteCandidate(candidate.applicationId)}
- value="Odstranit"
- />
- |
-
- {/each}
-
-
-
-
-
-
+ deleteCandidate(event.detail.id)} />