releaseArchivedNotice.tsx 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import {Alert} from 'sentry/components/alert';
  4. import {Button} from 'sentry/components/button';
  5. import {t} from 'sentry/locale';
  6. type Props = {
  7. multi?: boolean;
  8. onRestore?: () => void;
  9. };
  10. function ReleaseArchivedNotice({onRestore, multi}: Props) {
  11. return (
  12. <Alert type="warning">
  13. {multi
  14. ? t('These releases have been archived.')
  15. : t('This release has been archived.')}
  16. {!multi && onRestore && (
  17. <Fragment>
  18. {' '}
  19. <UnarchiveButton size="zero" priority="link" onClick={onRestore}>
  20. {t('Restore this release')}
  21. </UnarchiveButton>
  22. </Fragment>
  23. )}
  24. </Alert>
  25. );
  26. }
  27. const UnarchiveButton = styled(Button)`
  28. font-size: inherit;
  29. text-decoration: underline;
  30. &,
  31. &:hover,
  32. &:focus,
  33. &:active {
  34. color: ${p => p.theme.textColor};
  35. }
  36. `;
  37. export default ReleaseArchivedNotice;