diff --git a/src/lib/components/notes/NoteEditor.svelte b/src/lib/components/notes/NoteEditor.svelte new file mode 100644 index 000000000..c12511e04 --- /dev/null +++ b/src/lib/components/notes/NoteEditor.svelte @@ -0,0 +1,157 @@ + + +
+ {#if loading} +
+
+ +
+
+ {/if} + +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ {#if voiceInput} +
+ { + voiceInput = false; + }} + on:confirm={(e) => { + const { text, filename } = e.detail; + + // url is hostname + /cache/audio/transcription/ + filename + const url = `${window.location.origin}/cache/audio/transcription/${filename}`; + + // Open in new tab + + if (content.trim() !== '') { + content = `${content}\n\n${text}\n\nRecording: ${url}\n\n`; + } else { + content = `${content}${text}\n\nRecording: ${url}\n\n`; + } + + voiceInput = false; + }} + /> +
+ {:else} + + + + {/if} + + +
+
diff --git a/src/lib/components/notes/Notes.svelte b/src/lib/components/notes/Notes.svelte index 6ebb8be63..2ff3503fb 100644 --- a/src/lib/components/notes/Notes.svelte +++ b/src/lib/components/notes/Notes.svelte @@ -95,68 +95,70 @@ - {#if Object.keys(notes).length > 0} - {#each Object.keys(notes) as timeRange} -
- {$i18n.t(timeRange)} -
+
+ {#if Object.keys(notes).length > 0} + {#each Object.keys(notes) as timeRange} +
+ {$i18n.t(timeRange)} +
-
- {#each notes[timeRange] as note, idx (note.id)} -
-
- -
-
{note.title}
-
- -
- {#if note.data?.content} - {note.data?.content} - {:else} - {$i18n.t('No content')} - {/if} -
- -
- - {/each} - {:else} -
-
-
- {$i18n.t('No Notes')} -
-
- {$i18n.t('Create your first note by clicking on the plus button below.')} +
+ {#if note.data?.content} + {note.data?.content} + {:else} + {$i18n.t('No content')} + {/if} +
+ +
+
+ {dayjs(note.updated_at / 1000000).fromNow()} +
+ +
+ {$i18n.t('By {{name}}', { + name: capitalizeFirstLetter( + note?.user?.name ?? note?.user?.email ?? $i18n.t('Deleted User') + ) + })} +
+
+
+ +
+
+ {/each} +
+ {/each} + {:else} +
+
+
+ {$i18n.t('No Notes')} +
+ +
+ {$i18n.t('Create your first note by clicking on the plus button below.')} +
-
- {/if} + {/if} +
diff --git a/src/routes/(app)/notes/+layout.svelte b/src/routes/(app)/notes/+layout.svelte index e2ebec71a..8b8792c94 100644 --- a/src/routes/(app)/notes/+layout.svelte +++ b/src/routes/(app)/notes/+layout.svelte @@ -85,7 +85,7 @@
-
+
diff --git a/src/routes/(app)/notes/[id]/+page.svelte b/src/routes/(app)/notes/[id]/+page.svelte index 262d8555a..737c0e00f 100644 --- a/src/routes/(app)/notes/[id]/+page.svelte +++ b/src/routes/(app)/notes/[id]/+page.svelte @@ -1,5 +1,6 @@ -{$page.params.id} +