feat: add attach from documents
Signed-off-by: Sebastian <krupinski01@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { ref } from 'vue'
|
||||
import type { PropType } from 'vue'
|
||||
import { EditorContent, type Editor } from '@tiptap/vue-3'
|
||||
import { documentsSelectorAvailable } from '@/services/documentsSelector'
|
||||
|
||||
defineProps({
|
||||
editor: {
|
||||
@@ -41,7 +42,8 @@ const emit = defineEmits<{
|
||||
bulletList: []
|
||||
orderedList: []
|
||||
link: []
|
||||
attach: [files: File[]]
|
||||
attachFromDevice: [files: File[]]
|
||||
attachFromDocuments: []
|
||||
}>()
|
||||
|
||||
const fileInput = ref<HTMLInputElement | null>(null)
|
||||
@@ -54,7 +56,7 @@ function handleFileChange(event: Event) {
|
||||
const input = event.target as HTMLInputElement | null
|
||||
const files = input?.files ? Array.from(input.files) : []
|
||||
if (files.length > 0) {
|
||||
emit('attach', files)
|
||||
emit('attachFromDevice', files)
|
||||
}
|
||||
if (input) {
|
||||
input.value = ''
|
||||
@@ -142,6 +144,11 @@ function handleFileChange(event: Event) {
|
||||
<v-icon>mdi-paperclip</v-icon>
|
||||
<v-tooltip activator="parent" location="bottom">Attach Files</v-tooltip>
|
||||
</v-btn>
|
||||
|
||||
<v-btn v-if="documentsSelectorAvailable()" icon size="small" @click="$emit('attachFromDocuments')">
|
||||
<v-icon>mdi-folder-search-outline</v-icon>
|
||||
<v-tooltip activator="parent" location="bottom">Attach from Documents</v-tooltip>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
|
||||
<v-divider />
|
||||
|
||||
Reference in New Issue
Block a user