mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +00:00
- Adds pagination support for search. - Use composition API on all search related component. - Minor UI improvements. - Adds missing specs Loom video https://www.loom.com/share/5b01afa5c9204e7d97ff81b215621dde?sid=82ca6d22-ca8c-4d5e-8740-ba06ca4051ba
51 lines
1.1 KiB
Vue
51 lines
1.1 KiB
Vue
<script setup>
|
|
import { useMapGetter } from 'dashboard/composables/store.js';
|
|
|
|
import SearchResultSection from './SearchResultSection.vue';
|
|
import SearchResultContactItem from './SearchResultContactItem.vue';
|
|
|
|
defineProps({
|
|
contacts: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
query: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
isFetching: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
showTitle: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
});
|
|
|
|
const accountId = useMapGetter('getCurrentAccountId');
|
|
</script>
|
|
|
|
<template>
|
|
<SearchResultSection
|
|
:title="$t('SEARCH.SECTION.CONTACTS')"
|
|
:empty="!contacts.length"
|
|
:query="query"
|
|
:show-title="showTitle"
|
|
:is-fetching="isFetching"
|
|
>
|
|
<ul v-if="contacts.length" class="space-y-1.5 list-none">
|
|
<li v-for="contact in contacts" :key="contact.id">
|
|
<SearchResultContactItem
|
|
:id="contact.id"
|
|
:name="contact.name"
|
|
:email="contact.email"
|
|
:phone="contact.phone_number"
|
|
:account-id="accountId"
|
|
:thumbnail="contact.thumbnail"
|
|
/>
|
|
</li>
|
|
</ul>
|
|
</SearchResultSection>
|
|
</template>
|