actionButtons.tsx 885 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import styled from '@emotion/styled';
  2. import {Button} from 'sentry/components/button';
  3. import {IconDelete} from 'sentry/icons';
  4. import {space} from 'sentry/styles/space';
  5. import {Organization, SentryFunction} from 'sentry/types';
  6. type Props = {
  7. onDelete: (org: Organization, sentryFn: SentryFunction) => void;
  8. org: Organization;
  9. sentryFn: SentryFunction;
  10. };
  11. function ActionButtons({org, sentryFn, onDelete}: Props) {
  12. const deleteButton = (
  13. <StyledButton
  14. size="sm"
  15. icon={<IconDelete />}
  16. aria-label="Delete"
  17. onClick={() => onDelete(org, sentryFn)}
  18. />
  19. );
  20. return <ButtonHolder>{deleteButton}</ButtonHolder>;
  21. }
  22. const StyledButton = styled(Button)`
  23. color: ${p => p.theme.subText};
  24. `;
  25. const ButtonHolder = styled('div')`
  26. flex-direction: row;
  27. display: flex;
  28. & > * {
  29. margin-left: ${space(0.5)};
  30. }
  31. `;
  32. export default ActionButtons;