useSharedVisualConfig.ts 771 B

1234567891011121314151617181920212223242526272829
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { TooltipVisualConfig } from '#shared/components/CommonTooltip/types.ts'
  3. import type { ObjectAttributesConfig } from '#shared/components/ObjectAttributes/types.ts'
  4. export interface SharedVisualConfig {
  5. objectAttributes: ObjectAttributesConfig
  6. tooltip: TooltipVisualConfig
  7. }
  8. const currentVisualConfig: SharedVisualConfig = {
  9. objectAttributes: {
  10. outer: 'div',
  11. wrapper: 'section',
  12. classes: {},
  13. },
  14. tooltip: {
  15. type: 'inline',
  16. component: () => null,
  17. },
  18. }
  19. export const useSharedVisualConfig = () => {
  20. return currentVisualConfig
  21. }
  22. export const setupCommonVisualConfig = (config: SharedVisualConfig) => {
  23. Object.assign(currentVisualConfig, config)
  24. }