Files
leadchat/app/javascript/dashboard/modules/search/components/SearchResultContactsList.vue
Nithin David Thomas 402428fb4d feat: Splits search api by resources to improve query time [cw-47] (#6942)
* feat: Splits search api by resources to improve query time

* Review fixes

* Spacing fixes

* Update app/javascript/dashboard/modules/search/components/SearchView.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* Review fixes

* Refactor searchview

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2023-04-25 17:59:38 +05:30

60 lines
1.2 KiB
Vue

<template>
<search-result-section
:title="$t('SEARCH.SECTION.CONTACTS')"
:empty="!contacts.length"
:query="query"
:show-title="showTitle"
:is-fetching="isFetching"
>
<ul class="search-list">
<li v-for="contact in contacts" :key="contact.id">
<search-result-contact-item
:id="contact.id"
:name="contact.name"
:email="contact.email"
:phone="contact.phone_number"
:account-id="accountId"
:thumbnail="contact.thumbnail"
/>
</li>
</ul>
</search-result-section>
</template>
<script>
import { mapGetters } from 'vuex';
import SearchResultSection from './SearchResultSection.vue';
import SearchResultContactItem from './SearchResultContactItem.vue';
export default {
components: {
SearchResultSection,
SearchResultContactItem,
},
props: {
contacts: {
type: Array,
default: () => [],
},
query: {
type: String,
default: '',
},
isFetching: {
type: Boolean,
default: false,
},
showTitle: {
type: Boolean,
default: true,
},
},
computed: {
...mapGetters({
accountId: 'getCurrentAccountId',
}),
},
};
</script>