Files
leadchat/app/javascript/dashboard/modules/search/components/SearchResultContactItem.vue
Nithin David Thomas 88ed028a06 feat: Revamps search to use new search API's (#6582)
* feat: Revamps search to use new search API's

* Fixes search result spacing

* Fixes message result

* Fixes issue with empty search results

* Remove console errors

* Remove console errors

* Fix console errors, canned responses

* Fixes message rendering on results

* Highlights search term

* Fixes html rendering for emails

* FIxes email rendering issues

* Removes extra spaces and line breaks

---------

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-03-03 20:58:21 +05:30

84 lines
1.6 KiB
Vue

<template>
<router-link :to="navigateTo" class="contact-item">
<woot-thumbnail :src="thumbnail" :username="name" size="24px" />
<div class="contact-details">
<h5 class="text-block-title name">{{ name }}</h5>
<p class="details-meta">
<span v-if="email" class="email">{{ email }}</span>
<span v-if="phone" class="separator"></span>
<span v-if="phone" class="phone">
{{ phone }}
</span>
</p>
</div>
</router-link>
</template>
<script>
import { frontendURL } from 'dashboard/helper/URLHelper';
export default {
props: {
id: {
type: [String, Number],
default: 0,
},
email: {
type: String,
default: '',
},
phone: {
type: String,
default: '',
},
name: {
type: String,
default: '',
},
thumbnail: {
type: String,
default: '',
},
accountId: {
type: [String, Number],
default: 0,
},
},
computed: {
navigateTo() {
return frontendURL(`accounts/${this.accountId}/contacts/${this.id}`);
},
},
};
</script>
<style scoped lang="scss">
.contact-item {
cursor: pointer;
display: flex;
align-items: center;
padding: var(--space-small);
border-radius: var(--border-radius-small);
&:hover {
background-color: var(--s-25);
}
}
.contact-details {
margin-left: var(--space-normal);
}
.name {
margin: 0;
}
.details-meta {
margin: 0;
color: var(--s-600);
font-size: var(--font-size-small);
display: flex;
align-items: center;
span {
margin-right: var(--space-smaller);
}
}
</style>