list.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* eslint-disable no-alert */
  2. import {Fragment} from 'react';
  3. import {Button} from 'sentry/components/button';
  4. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  5. import {ActionsProvider} from 'sentry/components/workflowEngine/layout/actions';
  6. import ListLayout from 'sentry/components/workflowEngine/layout/list';
  7. import {useWorkflowEngineFeatureGate} from 'sentry/components/workflowEngine/useWorkflowEngineFeatureGate';
  8. import {IconAdd} from 'sentry/icons';
  9. import {t} from 'sentry/locale';
  10. export default function AutomationsList() {
  11. useWorkflowEngineFeatureGate({redirect: true});
  12. return (
  13. <SentryDocumentTitle title={t('Automations')} noSuffix>
  14. <ActionsProvider actions={<Actions />}>
  15. <ListLayout>
  16. <h2>Automations</h2>
  17. </ListLayout>
  18. </ActionsProvider>
  19. </SentryDocumentTitle>
  20. );
  21. }
  22. function Actions() {
  23. const create = () => {
  24. window.alert('create');
  25. };
  26. return (
  27. <Fragment>
  28. <Button onClick={create} priority="primary" icon={<IconAdd isCircled />}>
  29. {t('Create Automation')}
  30. </Button>
  31. </Fragment>
  32. );
  33. }