autocomplete styling

This commit is contained in:
2023-05-04 23:48:39 +02:00
parent e606296585
commit 38a6255e77
6 changed files with 84 additions and 28 deletions

View File

@@ -0,0 +1,35 @@
<script setup lang="ts">
import { activeNote } from '@/composables/useNotes'
import { formatDate } from '@/utils/helpers'
const props = defineProps<{
result: Note
activeResult?: Note
}>()
const emit = defineEmits<{
(e: 'goToNote'): void
}>()
</script>
<template>
<li class="flex flex-row">
<a
class="flex-1 items-center px-2 py-1"
@click.stop.prevent="() => emit('goToNote')"
@mousedown.prevent
:class="{
disabled: activeNote?.id === result.id,
active: props.activeResult?.id === result.id,
}"
>
<span
class="badge-ghost badge badge-sm mr-0.5"
v-if="activeNote?.id === result.id"
>
current
</span>
<span class="flex-1">{{ result.title }}</span>
<span>{{ formatDate(result.modified) }}</span>
</a>
</li>
</template>