OrganizationMembersList.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import type { OrganizationQuery } from '@shared/graphql/types'
  4. import type { ConfidentTake } from '@shared/types/utils'
  5. import { computed } from 'vue'
  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. (e: 'load-more'): void
  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>