disabledDateRange.tsx 671 B

12345678910111213141516171819
  1. import DateRange from 'sentry/components/timeRangeSelector/dateRange';
  2. import {MAX_PICKABLE_DAYS} from 'sentry/constants';
  3. import withSubscription from 'getsentry/components/withSubscription';
  4. import type {Subscription} from 'getsentry/types';
  5. type Props = React.ComponentProps<typeof DateRange> & {
  6. subscription: Subscription;
  7. };
  8. function DisabledDateRange(props: Props) {
  9. const {subscription} = props;
  10. const maxPickableDays =
  11. props.maxPickableDays ?? subscription.planDetails?.retentionDays;
  12. return <DateRange {...props} maxPickableDays={maxPickableDays || MAX_PICKABLE_DAYS} />;
  13. }
  14. export default withSubscription(DisabledDateRange, {noLoader: true});