OrganizationMembersList.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. import type { OrganizationQuery } from '#shared/graphql/types.ts'
  5. import type { ConfidentTake } from '#shared/types/utils.ts'
  6. import CommonSectionMenu from '../CommonSectionMenu/CommonSectionMenu.vue'
  7. import CommonShowMoreButton from '../CommonShowMoreButton/CommonShowMoreButton.vue'
  8. import CommonUsersList from '../CommonUsersList/CommonUsersList.vue'
  9. interface Props {
  10. organization: ConfidentTake<OrganizationQuery, 'organization'>
  11. disableShowMore?: boolean
  12. }
  13. const props = defineProps<Props>()
  14. const emit = defineEmits<{
  15. 'load-more': []
  16. }>()
  17. const members = computed(() => {
  18. return props.organization.members?.edges.map(({ node }) => node) || []
  19. })
  20. </script>
  21. <template>
  22. <CommonSectionMenu v-if="members.length" :header-label="__('Members')">
  23. <CommonUsersList :users="members" />
  24. <CommonShowMoreButton
  25. :entities="members"
  26. :total-count="organization.members?.totalCount || 0"
  27. :disabled="disableShowMore"
  28. @click="emit('load-more')"
  29. />
  30. </CommonSectionMenu>
  31. </template>