index.ts 653 B

123456789101112131415161718192021222324
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { MenuItem } from '#desktop/components/CommonPopover/types.ts'
  3. export interface AvatarMenuPlugin extends MenuItem {
  4. order: number
  5. }
  6. const pluginModules = import.meta.glob<AvatarMenuPlugin>(
  7. ['./**/*.ts', '!./**/index.ts', '!./__tests__/**/*.ts'],
  8. {
  9. eager: true,
  10. import: 'default',
  11. },
  12. )
  13. export const avatarMenuPlugins = Object.values(pluginModules).sort(
  14. (p1, p2) => p1.order - p2.order,
  15. )
  16. export const avatarMenuItems = avatarMenuPlugins.map(
  17. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  18. ({ order, ...item }) => item,
  19. )