auto imports

This commit is contained in:
2023-05-12 23:28:02 +02:00
parent 282ff48f49
commit 3fed5ddd8d
17 changed files with 655 additions and 72 deletions

View File

@@ -1,7 +1,4 @@
<script setup lang="ts">
import { ref, watch, computed } from 'vue'
import NoteEditor from '@/components/NoteEditor.vue'
import Modal from '@/components/Modal.vue'
import { formatDate } from '@/utils/helpers'
import { notes, activeNote } from '@/composables/useNotes'
import { notesRelations } from '@/composables/useNotes'
@@ -30,13 +27,19 @@ const references = computed<Note[]>(() => {
})
.filter((note): note is Note => note !== undefined)
})
const deleteNote = () => {
console.log('delete note')
}
const setRootNote = () => {
console.log('set root note')
}
</script>
<template>
<div class="flex flex-col">
<div class="mb-2 flex items-center">
<h1
class="mr-2 flex flex-1 items-center rounded-md text-3xl font-semibold hover:bg-gray-200"
>
<NoteToolbar @delete="deleteNote" @set-root="setRootNote">
<template #title>
<i
class="fas fa-fw fa-home mr-2 text-base text-secondary opacity-40"
v-if="props.note.isRoot"
@@ -46,46 +49,8 @@ const references = computed<Note[]>(() => {
class="flex-1 bg-transparent py-1 outline-none"
v-model="noteTitle"
/>
</h1>
<div class="btn-group flex items-center">
<Modal>
<template #activator="{ open }">
<button class="btn-sm btn" @click="open">
<i class="fas fa-fw fa-trash" />
</button>
</template>
<template #default>Are you sure you want to delete this?</template>
<template #actions="{ close }">
<button
class="btn-primary btn-sm btn mr-1"
@click="() => console.log('delete note')"
>
Delete note
</button>
<button class="btn-sm btn" @click="close">Close</button>
</template>
</Modal>
<Modal>
<template #activator="{ open }">
<button class="btn-sm btn" @click="open">
<i class="fas fa-fw fa-sitemap" />
</button>
</template>
<template #default>
Are you sure you want to set this note as root note?
</template>
<template #actions="{ close }">
<button
class="btn-primary btn-sm btn mr-1"
@click="() => console.log('set root note')"
>
Set current note as root
</button>
<button class="btn-sm btn" @click="close">Close</button>
</template>
</Modal>
</div>
</div>
</template>
</NoteToolbar>
<NoteEditor
class="h-100 flex-1 overflow-auto"
:note="activeNote"