monitorHeader.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. },
  18. {
  19. label: t('Cron Monitor Details'),
  20. },
  21. ];
  22. return (
  23. <Layout.Header>
  24. <Layout.HeaderContent>
  25. <Breadcrumbs crumbs={crumbs} />
  26. <Layout.Title>
  27. <IdBadge
  28. project={monitor.project}
  29. avatarSize={28}
  30. hideName
  31. avatarProps={{hasTooltip: true, tooltip: monitor.project.slug}}
  32. />
  33. {monitor.name}
  34. </Layout.Title>
  35. </Layout.HeaderContent>
  36. <Layout.HeaderActions>
  37. <MonitorHeaderActions orgId={orgId} monitor={monitor} onUpdate={onUpdate} />
  38. </Layout.HeaderActions>
  39. </Layout.Header>
  40. );
  41. }
  42. export default MonitorHeader;