Skip to content

Commit

Permalink
fix: prevent empty HQ filters list to take space
Browse files Browse the repository at this point in the history
  • Loading branch information
CachedaCodes committed Nov 9, 2023
1 parent 09a9d64 commit cceec40
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/history-query-filters.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div v-if="filtersList && filtersList.length" class="x-text1-sm x-flex x-gap-8 x-text-lead-50">
<div v-if="filtersWithLabel.length" class="x-text1-sm x-flex x-gap-8 x-text-lead-50">
<div class="x-truncate">
<span v-for="filter in filtersList" :key="filter.id" class="x-pr-8">
<span v-for="filter in filtersWithLabel" :key="filter.id" class="x-pr-8">
{{ filter.label }}
</span>
</div>
Expand All @@ -10,7 +10,7 @@
</template>

<script lang="ts">
import { HistoryQuery } from '@empathyco/x-types';
import { Filter, HistoryQuery } from '@empathyco/x-types';
import { defineComponent, PropType } from 'vue';
export default defineComponent({
Expand All @@ -25,6 +25,13 @@
required: false,
default: false
}
},
setup(props) {
return {
filtersWithLabel: props.filtersList?.filter(
filter => (filter as Filter & { label?: string }).label
)
};
}
});
</script>

0 comments on commit cceec40

Please sign in to comment.