diff --git a/lib/frontend/components/AppContainer.svelte b/lib/frontend/components/AppContainer.svelte
index 6d1b838..f7f646f 100644
--- a/lib/frontend/components/AppContainer.svelte
+++ b/lib/frontend/components/AppContainer.svelte
@@ -1,12 +1,18 @@
{#if showTrackingPanel}
{/if}
+{#if showEventList}
+
+{/if}
+
diff --git a/lib/frontend/components/EventList.svelte b/lib/frontend/components/EventList.svelte
new file mode 100644
index 0000000..28405c8
--- /dev/null
+++ b/lib/frontend/components/EventList.svelte
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+ Date |
+ Name |
+ |
+
+
+
+ {#each $eventStore as event (event.id)}
+
+
+ {event.startTime
+ ? new Date(event.startTime).toLocaleString()
+ : 'N/A\xa0\xa0\xa0\xa0\xa0'
+ }
+ |
+
+ {event.title}
+ |
+
+ handleRecordDelete(event.id)}
+ >
+ ✖︎
+
+ |
+
+ {/each}
+
+
+
diff --git a/lib/frontend/stores/eventStore.js b/lib/frontend/stores/eventStore.js
index c4f21bd..4176863 100644
--- a/lib/frontend/stores/eventStore.js
+++ b/lib/frontend/stores/eventStore.js
@@ -30,7 +30,10 @@ const createEventStore = () => {
return
}
- set(state.splice(calculationIndex, 1))
+ const nextState = [ ...state ]
+ nextState.splice(calculationIndex, 1)
+
+ set(nextState)
}
const getState = () => state
diff --git a/lib/frontend/utils.js b/lib/frontend/utils.js
new file mode 100644
index 0000000..1412440
--- /dev/null
+++ b/lib/frontend/utils.js
@@ -0,0 +1,25 @@
+export const migrateRecord = (record) => {
+ // NOTE: v3 records
+ const id = record.id || record.order
+ const startTime = record.startTime || null
+
+ return {
+ ...record,
+ id,
+ startTime,
+ }
+}
+
+export const sortRecord = (a, b) => {
+ const aDate = new Date(a.createdAt)
+ const bDate = new Date(b.createdAt)
+
+ if (aDate < bDate) {
+ return -1
+ }
+ if (aDate > bDate) {
+ return 1
+ }
+ return 0
+}
+