detail.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* eslint-disable no-alert */
  2. import {Fragment} from 'react';
  3. import {Button, LinkButton} from 'sentry/components/button';
  4. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  5. import {ActionsProvider} from 'sentry/components/workflowEngine/layout/actions';
  6. import {BreadcrumbsProvider} from 'sentry/components/workflowEngine/layout/breadcrumbs';
  7. import DetailLayout from 'sentry/components/workflowEngine/layout/detail';
  8. import {useWorkflowEngineFeatureGate} from 'sentry/components/workflowEngine/useWorkflowEngineFeatureGate';
  9. import {IconEdit} from 'sentry/icons';
  10. import {t} from 'sentry/locale';
  11. export default function AutomationDetail() {
  12. useWorkflowEngineFeatureGate({redirect: true});
  13. return (
  14. <SentryDocumentTitle title={t('Automation')} noSuffix>
  15. <BreadcrumbsProvider crumb={{label: t('Automations'), to: '/automations'}}>
  16. <ActionsProvider actions={<Actions />}>
  17. <DetailLayout>
  18. <DetailLayout.Main>main</DetailLayout.Main>
  19. <DetailLayout.Sidebar>sidebar</DetailLayout.Sidebar>
  20. </DetailLayout>
  21. </ActionsProvider>
  22. </BreadcrumbsProvider>
  23. </SentryDocumentTitle>
  24. );
  25. }
  26. function Actions() {
  27. const disable = () => {
  28. window.alert('disable');
  29. };
  30. return (
  31. <Fragment>
  32. <Button onClick={disable}>{t('Disable')}</Button>
  33. <LinkButton to="/monitors/edit" priority="primary" icon={<IconEdit />}>
  34. {t('Edit')}
  35. </LinkButton>
  36. </Fragment>
  37. );
  38. }