aiPageHeader.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import normalizeUrl from 'sentry/utils/url/normalizeUrl';
  2. import useOrganization from 'sentry/utils/useOrganization';
  3. import {
  4. AI_LANDING_SUB_PATH,
  5. AI_LANDING_TITLE,
  6. } from 'sentry/views/insights/pages/ai/settings';
  7. import {
  8. DomainViewHeader,
  9. type Props as HeaderProps,
  10. } from 'sentry/views/insights/pages/domainViewHeader';
  11. import {DOMAIN_VIEW_BASE_URL} from 'sentry/views/insights/pages/settings';
  12. import {ModuleName} from 'sentry/views/insights/types';
  13. type Props = {
  14. headerTitle: HeaderProps['headerTitle'];
  15. breadcrumbs?: HeaderProps['additionalBreadCrumbs'];
  16. headerActions?: HeaderProps['additonalHeaderActions'];
  17. module?: HeaderProps['selectedModule'];
  18. };
  19. export function AiHeader({module, headerTitle, headerActions, breadcrumbs}: Props) {
  20. const {slug} = useOrganization();
  21. const aiBaseUrl = normalizeUrl(
  22. `/organizations/${slug}/${DOMAIN_VIEW_BASE_URL}/${AI_LANDING_SUB_PATH}/`
  23. );
  24. const modules = [ModuleName.AI];
  25. return (
  26. <DomainViewHeader
  27. domainBaseUrl={aiBaseUrl}
  28. headerTitle={headerTitle}
  29. domainTitle={AI_LANDING_TITLE}
  30. modules={modules}
  31. selectedModule={module}
  32. additonalHeaderActions={headerActions}
  33. additionalBreadCrumbs={breadcrumbs}
  34. />
  35. );
  36. }