index.tsx 921 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import Dialog from '../Dialog';
  4. import Button from '../Button';
  5. import {
  6. TextWrapper, BtnWrapper,
  7. } from './styled';
  8. type Props = {
  9. open: boolean;
  10. onCancel: (e: any) => void;
  11. onDelete: (e: any) => void;
  12. };
  13. const index: React.FC<Props> = ({
  14. open,
  15. onCancel,
  16. onDelete,
  17. }: Props) => {
  18. const { t } = useTranslation('dialog');
  19. return (
  20. <Dialog open={open}>
  21. <TextWrapper>
  22. {t('deleteAnnotationAlert')}
  23. </TextWrapper>
  24. <BtnWrapper>
  25. <Button
  26. appearance="default-hollow"
  27. onClick={onCancel}
  28. >
  29. {t('cancel')}
  30. </Button>
  31. <Button
  32. appearance="primary"
  33. onClick={onDelete}
  34. style={{ marginLeft: '16px' }}
  35. >
  36. {t('continue')}
  37. </Button>
  38. </BtnWrapper>
  39. </Dialog>
  40. );
  41. };
  42. export default index;