SearchResults.vue 695 B

12345678910111213141516171819202122232425262728
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. import { replaceTags } from '#shared/utils/formatter.ts'
  5. import { useSearchPlugins } from '../plugins/index.ts'
  6. interface Props {
  7. type: string
  8. data: Record<string, unknown>[]
  9. }
  10. const props = defineProps<Props>()
  11. const searchPlugins = useSearchPlugins()
  12. const plugin = computed(() => searchPlugins[props.type])
  13. </script>
  14. <template>
  15. <template v-for="item in data" :key="item.id">
  16. <CommonLink :link="replaceTags(plugin.link, item, true)">
  17. <component :is="plugin.component" :entity="item" />
  18. </CommonLink>
  19. </template>
  20. </template>