DiscardButton.tsx 941 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { h } from 'preact'
  2. import type { I18n } from '@uppy/utils/lib/Translator'
  3. interface DiscardButtonProps {
  4. onDiscard: () => void
  5. i18n: I18n
  6. }
  7. function DiscardButton({ onDiscard, i18n }: DiscardButtonProps): JSX.Element {
  8. return (
  9. <button
  10. className="uppy-u-reset uppy-c-btn uppy-Audio-button"
  11. type="button"
  12. title={i18n('discardRecordedFile')}
  13. aria-label={i18n('discardRecordedFile')}
  14. onClick={onDiscard}
  15. data-uppy-super-focusable
  16. >
  17. <svg
  18. width="13"
  19. height="13"
  20. viewBox="0 0 13 13"
  21. xmlns="http://www.w3.org/2000/svg"
  22. aria-hidden="true"
  23. className="uppy-c-icon"
  24. >
  25. <g fill="#FFF" fillRule="evenodd">
  26. <path d="M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z" />
  27. <path d="M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z" />
  28. </g>
  29. </svg>
  30. </button>
  31. )
  32. }
  33. export default DiscardButton