|
8 | 8 | import { superValidate } from 'sveltekit-superforms'; |
9 | 9 | import { zod } from 'sveltekit-superforms/adapters'; |
10 | 10 | import { tableHandlers } from '$lib/utils/stores'; |
| 11 | + import { getModalStore } from './stores'; |
| 12 | +
|
| 13 | + const modalStore = getModalStore(); |
11 | 14 |
|
12 | 15 | let fileResetSignal = $state(false); |
13 | 16 |
|
14 | 17 | let { parent } = $props(); |
15 | 18 | </script> |
16 | 19 |
|
17 | 20 | {#if page.data.user.is_admin} |
18 | | - <div class="card bg-white p-4 mt-4 shadow-sm"> |
| 21 | + <div class="card bg-white p-6 w-full max-w-lg shadow-xl space-y-4 rounded-xl"> |
| 22 | + <div class="flex items-center justify-between"> |
| 23 | + <header class="flex items-center gap-3"> |
| 24 | + <div |
| 25 | + class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary-100 text-primary-600" |
| 26 | + > |
| 27 | + <i class="fa-solid fa-file-circle-plus text-lg"></i> |
| 28 | + </div> |
| 29 | + <h3 class="text-xl font-bold text-gray-800"> |
| 30 | + {m.customExternalLibrary()} |
| 31 | + </h3> |
| 32 | + </header> |
| 33 | + <button |
| 34 | + type="button" |
| 35 | + class="flex items-center justify-center w-8 h-8 rounded-md text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors" |
| 36 | + onclick={parent.onClose} |
| 37 | + aria-label="Close" |
| 38 | + > |
| 39 | + <i class="fa-solid fa-xmark"></i> |
| 40 | + </button> |
| 41 | + </div> |
| 42 | + <p class="text-sm text-gray-500">{m.libraryAddHelpText()}</p> |
| 43 | + <hr class="border-gray-200" /> |
19 | 44 | {#await superValidate(zod(LibraryUploadSchema))} |
20 | | - <h1>{m.loadingLibraryUploadButton()}...</h1> |
| 45 | + <p class="text-gray-500">{m.loadingLibraryUploadButton()}...</p> |
21 | 46 | {:then form} |
22 | 47 | <SuperForm |
23 | | - class="flex flex-col space-y-3" |
| 48 | + class="flex flex-col space-y-4" |
24 | 49 | dataType="form" |
25 | 50 | enctype="multipart/form-data" |
26 | 51 | data={form} |
|
51 | 76 | allowedExtensions={['yaml', 'yml', 'xlsx']} |
52 | 77 | /> |
53 | 78 | <button |
54 | | - class="btn preset-filled-primary-500 font-semibold w-full" |
| 79 | + class="btn preset-filled-primary-500 font-semibold w-full rounded-lg py-2.5" |
55 | 80 | data-testid="save-button" |
56 | | - type="submit">{m.add()}</button |
| 81 | + type="submit" |
57 | 82 | > |
| 83 | + <i class="fa-solid fa-upload mr-2"></i> |
| 84 | + {m.add()} |
| 85 | + </button> |
58 | 86 | {/snippet} |
59 | 87 | </SuperForm> |
60 | 88 | {:catch err} |
61 | | - <h1>{m.errorOccurredWhileLoadingLibrary()}: {err}</h1> |
| 89 | + <p class="text-red-600">{m.errorOccurredWhileLoadingLibrary()}: {err}</p> |
62 | 90 | {/await} |
63 | 91 | </div> |
64 | 92 | {/if} |
0 commit comments