mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
Porting changes from https://github.com/chatwoot/chatwoot/pull/10552 --------- Co-authored-by: Pranav <pranav@chatwoot.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com> Co-authored-by: Sojan <sojan@pepalo.com> Co-authored-by: iamsivin <iamsivin@gmail.com> Co-authored-by: Pranav <pranavrajs@gmail.com>
51 lines
1.1 KiB
Vue
51 lines
1.1 KiB
Vue
<script setup>
|
|
import { computed } from 'vue';
|
|
|
|
const props = defineProps({
|
|
title: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
empty: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
query: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
showTitle: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
isFetching: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
});
|
|
|
|
const titleCase = computed(() => props.title.toLowerCase());
|
|
</script>
|
|
|
|
<template>
|
|
<section class="mx-0 my-2">
|
|
<div v-if="showTitle" class="sticky top-0 p-2 z-50 mb-0.5 bg-n-background">
|
|
<h3 class="text-sm text-n-slate-12">{{ title }}</h3>
|
|
</div>
|
|
<woot-loading-state
|
|
v-if="isFetching"
|
|
:message="$t('SEARCH.SEARCHING_DATA')"
|
|
/>
|
|
<slot v-else />
|
|
<div
|
|
v-if="empty && !isFetching"
|
|
class="flex items-center justify-center px-4 py-6 m-2 rounded-md bg-n-slate-2 dark:bg-n-solid-3"
|
|
>
|
|
<fluent-icon icon="info" size="16px" class="text-n-slate-11" />
|
|
<p class="mx-2 my-0 text-center text-n-slate-11">
|
|
{{ $t('SEARCH.EMPTY_STATE', { item: titleCase, query }) }}
|
|
</p>
|
|
</div>
|
|
</section>
|
|
</template>
|