From ba28c0148cab26fcaf523e84731ffb7c416b3338 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Wed, 13 Mar 2024 17:35:05 +0000
Subject: Add import page

---
 components/loader/LoaderDiscardSessionModal.vue | 48 +++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 components/loader/LoaderDiscardSessionModal.vue

(limited to 'components/loader/LoaderDiscardSessionModal.vue')

diff --git a/components/loader/LoaderDiscardSessionModal.vue b/components/loader/LoaderDiscardSessionModal.vue
new file mode 100644
index 0000000..845b10a
--- /dev/null
+++ b/components/loader/LoaderDiscardSessionModal.vue
@@ -0,0 +1,48 @@
+<script setup lang="ts">
+const session = useSessionStore();
+
+const showModal = ref(false);
+
+const open = () => {
+  showModal.value = true;
+}
+
+const confirm = () => {
+  session.setQuests([]);
+  session.setCategories([]);
+  session.setItems([]);
+  session.setSessionType('none');
+
+  navigateToEditorPane(null);
+
+  showModal.value = false;
+}
+
+defineExpose({
+  open
+})
+</script>
+
+<template>
+  <Modal v-model="showModal">
+    <template v-slot:header>
+      <h2>Discard current session</h2>
+    </template>
+
+    <p>You are about to discard your current session. All changes will be lost.
+      Do you want to continue?</p>
+
+    <div id="controls" class="control-group">
+      <Button :icon="['fas', 'xmark']" :label="'Cancel'" @click="showModal = false"></Button>
+      <Button type="solid" accent="danger" :icon="['fas', 'trash']" :label="'Confirm'" @click="confirm"></Button>
+    </div>
+  </Modal>
+</template>
+
+<style scoped>
+#controls {
+  display: flex;
+  justify-content: flex-end;
+  margin-top: 1rem;
+}
+</style>
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

