extraDescription.tsx 919 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {t, tct} from 'sentry/locale';
  2. import {BULK_LIMIT, BULK_LIMIT_STR} from './utils';
  3. type Props = {
  4. all: boolean;
  5. query: string;
  6. queryCount: number;
  7. };
  8. function ExtraDescription({all, query, queryCount}: Props) {
  9. if (!all) {
  10. return null;
  11. }
  12. if (query) {
  13. return (
  14. <div>
  15. <p>{t('This will apply to the current search query') + ':'}</p>
  16. <pre>{query}</pre>
  17. </div>
  18. );
  19. }
  20. return (
  21. <p className="error">
  22. <strong>
  23. {queryCount > BULK_LIMIT
  24. ? tct(
  25. 'This will apply to the first [bulkNumber] issues matched in this project!',
  26. {
  27. bulkNumber: BULK_LIMIT_STR,
  28. }
  29. )
  30. : tct('This will apply to all [bulkNumber] issues matched in this project!', {
  31. bulkNumber: queryCount,
  32. })}
  33. </strong>
  34. </p>
  35. );
  36. }
  37. export default ExtraDescription;