From 9a11e0f4a38297006b89cc7bb2a60734111582e0 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Sun, 10 Mar 2024 00:13:25 +0000
Subject: Migrate to nuxt

---
 components/Editor/EditorSidebarQuest.vue | 68 ++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 components/Editor/EditorSidebarQuest.vue

(limited to 'components/Editor/EditorSidebarQuest.vue')

diff --git a/components/Editor/EditorSidebarQuest.vue b/components/Editor/EditorSidebarQuest.vue
new file mode 100644
index 0000000..baf06f1
--- /dev/null
+++ b/components/Editor/EditorSidebarQuest.vue
@@ -0,0 +1,68 @@
+<script setup lang="ts">
+import { useSessionStore, type EditorQuest } from '@/stores/session';
+import { computed, toRefs } from 'vue';
+import { stripColorCodes } from '@/lib/util';
+
+const props = defineProps<{
+  quest: EditorQuest;
+}>();
+
+const { quest } = toRefs(props);
+
+const sessionStore = useSessionStore();
+
+const setSelectedQuest = () => {
+  sessionStore.setEditorSelected('Quest', quest.value.id);
+};
+
+const selected = computed(() => {
+  return sessionStore.editor.selected.type === 'Quest' && sessionStore.editor.selected.id === quest.value.id;
+});
+</script>
+
+<template>
+  <div id="quest-container" @click.stop="setSelectedQuest" :class="{selected: selected}">
+    <span id="quest-title">
+      <font-awesome-icon class="quest-icon" :icon="['far', 'fa-compass']"/> 
+      <span id="quest-name">
+        <span id="quest-display-name">{{ stripColorCodes(quest.display.name) }}</span> 
+        <code id="quest-display-id">{{ quest.id }}</code> 
+      </span>
+    </span>
+  </div>
+</template>
+
+<style scoped>
+#quest-container {
+  cursor: pointer;
+  padding: 0.3rem 1rem;
+  transition: background-color 0.3s;
+
+  #quest-title {
+    display: flex;
+    align-items: center;
+    margin: 0;
+    gap: 0.5rem;
+    font-size: 0.8rem;
+    
+    #quest-name {
+      display: flex;
+      flex-direction: column;
+      align-items: left;
+      
+      #quest-display-id {
+        font-size: 0.6rem;
+        color: var(--color-text-mute);
+      }
+    }
+  }
+}
+
+.selected {
+  background-color: var(--color-primary-mute) !important;
+}
+
+#quest-container:hover {
+  background-color: var(--color-hover);
+}
+</style>
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

