diff --git a/src/components/PersonList.vue b/src/components/PersonList.vue index c03ae48..e065311 100644 --- a/src/components/PersonList.vue +++ b/src/components/PersonList.vue @@ -11,6 +11,7 @@ const entitiesStore = useEntitiesStore() const props = defineProps<{ selectedCollection?: CollectionObject | null selectedEntity?: EntityObject | null + search?: string | null }>() // Emits @@ -21,7 +22,6 @@ const emit = defineEmits<{ // State const loading = ref(false) -const searchQuery = ref('') // Entities belonging to the selected collection, sourced live from the manager store const collectionEntities = computed(() => { @@ -34,10 +34,10 @@ const collectionEntities = computed(() => { // Computed const filteredEntities = computed(() => { - if (!searchQuery.value) { + const query = (props.search ?? '').trim().toLowerCase() + if (!query) { return collectionEntities.value } - const query = searchQuery.value.toLowerCase() return collectionEntities.value.filter(entity => { const props = (entity.properties as any) const given = props?.names?.given || '' @@ -163,18 +163,6 @@ function entityAvatarColor(entity: EntityObject): string {