From 0f2240c87a5c0a22e2db97e4d2b82a52401be668 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Thu, 15 Feb 2024 17:23:22 +0000
Subject: Add modals

---
 .../Editor/Quest/Modal/RenameQuestModal.vue        | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 src/components/Editor/Quest/Modal/RenameQuestModal.vue

(limited to 'src/components/Editor/Quest/Modal/RenameQuestModal.vue')

diff --git a/src/components/Editor/Quest/Modal/RenameQuestModal.vue b/src/components/Editor/Quest/Modal/RenameQuestModal.vue
new file mode 100644
index 0000000..5b1e0ed
--- /dev/null
+++ b/src/components/Editor/Quest/Modal/RenameQuestModal.vue
@@ -0,0 +1,59 @@
+<script setup lang="ts">
+import Modal from '@/components/Control/Modal.vue';
+import Button from '@/components/Control/Button.vue';
+import { ref } from 'vue';
+
+const model = defineModel();
+
+const emit = defineEmits(['update']);
+
+const props = defineProps({
+  questId: String,
+});
+
+const newQuestId = ref(props.questId);
+</script>
+
+<template>
+  <Modal v-model="model">
+    <template v-slot:header>
+      <h2>Rename quest '{{ questId }}'</h2>
+    </template>
+
+    <template v-slot:body>
+      <div id="body">
+        <div class="option-group">
+          <label for="new-type">New quest ID</label>
+          <input id="new-type" name="new-type" type="text" v-model="newQuestId" />
+        </div>
+        <p>A Quest ID must be unique, alphanumeric, and not contain any spaces.</p>
+        <div id="confirm" class="control-group">
+          <Button
+            :icon="['fas', 'fa-times']"
+            :label="'Cancel'"
+            @click="model = false"
+          ></Button>
+          <Button
+            type="solid"
+            :icon="['fas', 'fa-check']"
+            :label="'Rename'"
+            @click="emit('update', newQuestId)"
+          ></Button>
+        </div>
+      </div>
+    </template>
+  </Modal>
+</template>
+
+<style scoped>
+#confirm {
+  display: flex;
+  justify-content: flex-end;
+}
+
+#body {
+  display: flex;
+  flex-direction: column;
+  gap: 0.5rem;
+}
+</style>
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

