{
- selectedMemory = memory;
- showEditMemoryModal = true;
- }}
+ class="group w-full flex justify-between items-center text-sm py-1 px-1"
>
-
-
{memory.content}
-
- {dayjs(memory.updated_at * 1000).format('MMM D, YYYY')}
+
+
+ {memoryTypeLabel(memory)}
+
+ {#if memoryUpdatedAt(memory)}
+
+ {memoryUpdatedAt(memory)}
+
+ {/if}
+
- {dayjs(memory.updated_at * 1000).format('h:mm A')}
-
-
-
-
{
+ if (!selectedMemory) return;
+
const res = await deleteMemoryById(localStorage.token, selectedMemory.id).catch((error) => {
toast.error(`${error}`);
return null;
@@ -306,7 +266,7 @@
if (res) {
toast.success($i18n.t('Memory deleted successfully'));
- memories = await getMemories(localStorage.token);
+ await loadMemories();
}
showDeleteConfirm = false;
}}
@@ -314,10 +274,10 @@
showDeleteConfirm = false;
}}
>
-
+
{$i18n.t('Are you sure you want to delete this memory? This action cannot be undone.')}
{selectedMemory?.content}
@@ -327,7 +287,7 @@
{
- memories = await getMemories(localStorage.token);
+ await loadMemories();
}}
/>
@@ -335,6 +295,6 @@
bind:show={showEditMemoryModal}
memory={selectedMemory}
on:save={async () => {
- memories = await getMemories(localStorage.token);
+ await loadMemories();
}}
/>