monitorHeader.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import Breadcrumbs from 'sentry/components/breadcrumbs';
  2. import IdBadge from 'sentry/components/idBadge';
  3. import * as Layout from 'sentry/components/layouts/thirds';
  4. import {t} from 'sentry/locale';
  5. import {Monitor} from '../types';
  6. import MonitorHeaderActions from './monitorHeaderActions';
  7. interface Props {
  8. monitor: Monitor;
  9. onUpdate: (data: Monitor) => void;
  10. orgId: string;
  11. }
  12. function MonitorHeader({monitor, orgId, onUpdate}: Props) {
  13. const crumbs = [
  14. {
  15. label: t('Crons'),
  16. to: `/organizations/${orgId}/crons/`,
  17. preservePageFilters: true,
  18. },
  19. {
  20. label: t('Cron Monitor Details'),
  21. },
  22. ];
  23. return (
  24. <Layout.Header>
  25. <Layout.HeaderContent>
  26. <Breadcrumbs crumbs={crumbs} />
  27. <Layout.Title>
  28. <IdBadge
  29. project={monitor.project}
  30. avatarSize={28}
  31. hideName
  32. avatarProps={{hasTooltip: true, tooltip: monitor.project.slug}}
  33. />
  34. {monitor.name}
  35. </Layout.Title>
  36. </Layout.HeaderContent>
  37. <Layout.HeaderActions>
  38. <MonitorHeaderActions orgId={orgId} monitor={monitor} onUpdate={onUpdate} />
  39. </Layout.HeaderActions>
  40. </Layout.Header>
  41. );
  42. }
  43. export default MonitorHeader;