hooks.tsx 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. import type {Route, RouteComponentProps, RouteContextInterface} from 'react-router';
  2. import type {ChildrenRenderFn} from 'sentry/components/acl/feature';
  3. import type {Guide} from 'sentry/components/assistant/types';
  4. import type {ButtonProps} from 'sentry/components/button';
  5. import type {ProductSelectionProps} from 'sentry/components/onboarding/productSelection';
  6. import type SidebarItem from 'sentry/components/sidebar/sidebarItem';
  7. import type DateRange from 'sentry/components/timeRangeSelector/dateRange';
  8. import type SelectorItems from 'sentry/components/timeRangeSelector/selectorItems';
  9. import type {SVGIconProps} from 'sentry/icons/svgIcon';
  10. import type {Group} from 'sentry/types';
  11. import type {UseExperiment} from 'sentry/utils/useExperiment';
  12. import type {StatusToggleButtonProps} from 'sentry/views/monitors/components/statusToggleButton';
  13. import type {OrganizationStatsProps} from 'sentry/views/organizationStats/index';
  14. import type {RouteAnalyticsContext} from 'sentry/views/routeAnalyticsContextProvider';
  15. import type {NavigationItem, NavigationSection} from 'sentry/views/settings/types';
  16. import type {ExperimentKey} from './experiments';
  17. import type {Integration, IntegrationProvider} from './integrations';
  18. import type {Member, Organization} from './organization';
  19. import type {Project} from './project';
  20. import type {User} from './user';
  21. // XXX(epurkhiser): A Note about `_`.
  22. //
  23. // We add the `_: any` type int our hooks list to stop
  24. // typescript from doing too much type tightening. We should absolutely revisit
  25. // this in the future because all callbacks _should_ be allowed to be
  26. // functions, but doing so causes some unexpected issues and makes typescript
  27. // not happy. We still get a huge advantage of typing just by having each hook
  28. // type here however.
  29. /**
  30. * The Hooks type mapping is the master interface for all external Hooks into
  31. * the sentry frontend application.
  32. */
  33. export interface Hooks
  34. extends RouteHooks,
  35. ComponentHooks,
  36. CustomizationHooks,
  37. AnalyticsHooks,
  38. FeatureDisabledHooks,
  39. InterfaceChromeHooks,
  40. OnboardingHooks,
  41. SettingsHooks,
  42. FeatureSpecificHooks,
  43. ReactHooks,
  44. CallbackHooks {
  45. _: any;
  46. }
  47. export type HookName = keyof Hooks;
  48. /**
  49. * Route hooks.
  50. */
  51. export type RouteHooks = {
  52. 'routes:api': RoutesHook;
  53. 'routes:organization': RoutesHook;
  54. 'routes:root': RoutesHook;
  55. };
  56. /**
  57. * Component specific hooks for DateRange and SelectorItems
  58. * These components have plan specific overrides in getsentry
  59. */
  60. type DateRangeProps = React.ComponentProps<typeof DateRange>;
  61. type SelectorItemsProps = React.ComponentProps<typeof SelectorItems>;
  62. type DisabledMemberViewProps = RouteComponentProps<{orgId: string}, {}>;
  63. type MemberListHeaderProps = {
  64. members: Member[];
  65. organization: Organization;
  66. };
  67. type DisabledAppStoreConnectMultiple = {
  68. children: React.ReactNode;
  69. organization: Organization;
  70. };
  71. type DisabledCustomSymbolSources = {
  72. children: React.ReactNode;
  73. organization: Organization;
  74. };
  75. type DisabledMemberTooltipProps = {children: React.ReactNode};
  76. type DashboardHeadersProps = {organization: Organization};
  77. type ReplayFeedbackButton = {children: React.ReactNode};
  78. type ReplayListPageHeaderProps = {children?: React.ReactNode};
  79. type ReplayOnboardingAlertProps = {children: React.ReactNode};
  80. type ReplayOnboardingCTAProps = {children: React.ReactNode; organization: Organization};
  81. type ProductUnavailableCTAProps = {organization: Organization};
  82. type ProfilingBetaAlertBannerProps = {
  83. organization: Organization;
  84. };
  85. type ProfilingUpgradePlanButtonProps = ButtonProps & {
  86. children: React.ReactNode;
  87. fallback: React.ReactNode;
  88. organization: Organization;
  89. };
  90. type ProfilingAM1OrMMXUpgradeProps = {
  91. fallback: React.ReactNode;
  92. organization: Organization;
  93. };
  94. type CronsBillingBannerProps = {
  95. organization: Organization;
  96. };
  97. type OrganizationHeaderProps = {
  98. organization: Organization;
  99. };
  100. type ProductSelectionAvailabilityProps = Pick<
  101. ProductSelectionProps,
  102. 'lazyLoader' | 'skipLazyLoader' | 'platform' | 'withBottomMargin'
  103. > & {
  104. organization: Organization;
  105. };
  106. type FirstPartyIntegrationAlertProps = {
  107. integrations: Integration[];
  108. hideCTA?: boolean;
  109. wrapWithContainer?: boolean;
  110. };
  111. type FirstPartyIntegrationAdditionalCTAProps = {
  112. integrations: Integration[];
  113. };
  114. type AttemptCloseAttemptProps = {
  115. handleRemoveAccount: () => void;
  116. organizationSlugs: string[];
  117. };
  118. type CodecovLinkProps = {
  119. organization: Organization;
  120. };
  121. type QualitativeIssueFeedbackProps = {
  122. group: Group;
  123. organization: Organization;
  124. };
  125. type GuideUpdateCallback = (nextGuide: Guide | null, opts: {dismissed?: boolean}) => void;
  126. type MonitorCreatedCallback = (organization: Organization) => void;
  127. type SentryLogoProps = SVGIconProps & {
  128. pride?: boolean;
  129. };
  130. /**
  131. * Component wrapping hooks
  132. */
  133. export type ComponentHooks = {
  134. 'component:codecov-integration-settings-link': () => React.ComponentType<CodecovLinkProps>;
  135. 'component:codecov-integration-stacktrace-link': () => React.ComponentType<CodecovLinkProps>;
  136. 'component:confirm-account-close': () => React.ComponentType<AttemptCloseAttemptProps>;
  137. 'component:crons-list-page-header': () => React.ComponentType<CronsBillingBannerProps>;
  138. 'component:dashboards-header': () => React.ComponentType<DashboardHeadersProps>;
  139. 'component:disabled-app-store-connect-multiple': () => React.ComponentType<DisabledAppStoreConnectMultiple>;
  140. 'component:disabled-custom-symbol-sources': () => React.ComponentType<DisabledCustomSymbolSources>;
  141. 'component:disabled-member': () => React.ComponentType<DisabledMemberViewProps>;
  142. 'component:disabled-member-tooltip': () => React.ComponentType<DisabledMemberTooltipProps>;
  143. 'component:enhanced-org-stats': () => React.ComponentType<OrganizationStatsProps>;
  144. 'component:escalating-issues-banner-feedback': () => React.ComponentType<QualitativeIssueFeedbackProps>;
  145. 'component:first-party-integration-additional-cta': () => React.ComponentType<FirstPartyIntegrationAdditionalCTAProps>;
  146. 'component:first-party-integration-alert': () => React.ComponentType<FirstPartyIntegrationAlertProps>;
  147. 'component:header-date-range': () => React.ComponentType<DateRangeProps>;
  148. 'component:header-selector-items': () => React.ComponentType<SelectorItemsProps>;
  149. 'component:issue-priority-feedback': () => React.ComponentType<QualitativeIssueFeedbackProps>;
  150. 'component:member-list-header': () => React.ComponentType<MemberListHeaderProps>;
  151. 'component:monitor-status-toggle': () => React.ComponentType<StatusToggleButtonProps>;
  152. 'component:org-stats-banner': () => React.ComponentType<DashboardHeadersProps>;
  153. 'component:organization-header': () => React.ComponentType<OrganizationHeaderProps>;
  154. 'component:product-selection-availability': () => React.ComponentType<ProductSelectionAvailabilityProps>;
  155. 'component:product-unavailable-cta': () => React.ComponentType<ProductUnavailableCTAProps>;
  156. 'component:profiling-am1-or-mmx-upgrade': () => React.ComponentType<ProfilingAM1OrMMXUpgradeProps>;
  157. 'component:profiling-billing-banner': () => React.ComponentType<ProfilingBetaAlertBannerProps>;
  158. 'component:profiling-upgrade-plan-button': () => React.ComponentType<ProfilingUpgradePlanButtonProps>;
  159. 'component:replay-feedback-button': () => React.ComponentType<ReplayFeedbackButton>;
  160. 'component:replay-list-page-header': () => React.ComponentType<ReplayListPageHeaderProps> | null;
  161. 'component:replay-onboarding-alert': () => React.ComponentType<ReplayOnboardingAlertProps>;
  162. 'component:replay-onboarding-cta': () => React.ComponentType<ReplayOnboardingCTAProps>;
  163. 'component:replay-onboarding-cta-button': () => React.ComponentType<{}> | null;
  164. 'component:sentry-logo': () => React.ComponentType<SentryLogoProps>;
  165. 'component:superuser-access-category': React.ComponentType<any>;
  166. 'component:superuser-warning': React.ComponentType<any>;
  167. };
  168. /**
  169. * Customization hooks are advanced hooks that return render-prop style
  170. * components the allow for specific customizations of components.
  171. *
  172. * These are very similar to the component wrapping hooks
  173. */
  174. export type CustomizationHooks = {
  175. 'integrations:feature-gates': IntegrationsFeatureGatesHook;
  176. 'member-invite-button:customization': InviteButtonCustomizationHook;
  177. 'member-invite-modal:customization': InviteModalCustomizationHook;
  178. };
  179. /**
  180. * Analytics / tracking / and operational metrics backend hooks.
  181. */
  182. export type AnalyticsHooks = {
  183. 'analytics:init-user': AnalyticsInitUser;
  184. 'analytics:log-experiment': AnalyticsLogExperiment;
  185. 'analytics:raw-track-event': AnalyticsRawTrackEvent;
  186. 'metrics:event': MetricsEvent;
  187. };
  188. /**
  189. * feature-disabled:<feature-flag> hooks return components that will be
  190. * rendered in place for Feature components when the feature is not enabled.
  191. */
  192. export type FeatureDisabledHooks = {
  193. 'feature-disabled:alert-wizard-performance': FeatureDisabledHook;
  194. 'feature-disabled:alerts-page': FeatureDisabledHook;
  195. 'feature-disabled:codecov-integration-setting': FeatureDisabledHook;
  196. 'feature-disabled:custom-inbound-filters': FeatureDisabledHook;
  197. 'feature-disabled:dashboards-edit': FeatureDisabledHook;
  198. 'feature-disabled:dashboards-page': FeatureDisabledHook;
  199. 'feature-disabled:dashboards-sidebar-item': FeatureDisabledHook;
  200. 'feature-disabled:data-forwarding': FeatureDisabledHook;
  201. 'feature-disabled:discard-groups': FeatureDisabledHook;
  202. 'feature-disabled:discover-page': FeatureDisabledHook;
  203. 'feature-disabled:discover-saved-query-create': FeatureDisabledHook;
  204. 'feature-disabled:discover-sidebar-item': FeatureDisabledHook;
  205. 'feature-disabled:discover2-page': FeatureDisabledHook;
  206. 'feature-disabled:discover2-sidebar-item': FeatureDisabledHook;
  207. 'feature-disabled:events-page': FeatureDisabledHook;
  208. 'feature-disabled:events-sidebar-item': FeatureDisabledHook;
  209. 'feature-disabled:grid-editable-actions': FeatureDisabledHook;
  210. 'feature-disabled:incidents-sidebar-item': FeatureDisabledHook;
  211. 'feature-disabled:open-discover': FeatureDisabledHook;
  212. 'feature-disabled:open-in-discover': FeatureDisabledHook;
  213. 'feature-disabled:performance-new-project': FeatureDisabledHook;
  214. 'feature-disabled:performance-page': FeatureDisabledHook;
  215. 'feature-disabled:performance-quick-trace': FeatureDisabledHook;
  216. 'feature-disabled:performance-sidebar-item': FeatureDisabledHook;
  217. 'feature-disabled:profiling-page': FeatureDisabledHook;
  218. 'feature-disabled:profiling-sidebar-item': FeatureDisabledHook;
  219. 'feature-disabled:project-performance-score-card': FeatureDisabledHook;
  220. 'feature-disabled:project-selector-all-projects': FeatureDisabledHook;
  221. 'feature-disabled:project-selector-checkbox': FeatureDisabledHook;
  222. 'feature-disabled:rate-limits': FeatureDisabledHook;
  223. 'feature-disabled:relay': FeatureDisabledHook;
  224. 'feature-disabled:replay-sidebar-item': FeatureDisabledHook;
  225. 'feature-disabled:sso-basic': FeatureDisabledHook;
  226. 'feature-disabled:sso-saml2': FeatureDisabledHook;
  227. 'feature-disabled:starfish-view': FeatureDisabledHook;
  228. 'feature-disabled:trace-view-link': FeatureDisabledHook;
  229. };
  230. /**
  231. * Interface chrome hooks.
  232. */
  233. export type InterfaceChromeHooks = {
  234. footer: GenericComponentHook;
  235. 'help-modal:footer': HelpModalFooterHook;
  236. 'sidebar:bottom-items': SidebarBottomItemsHook;
  237. 'sidebar:help-menu': GenericOrganizationComponentHook;
  238. 'sidebar:item-label': SidebarItemLabelHook;
  239. 'sidebar:organization-dropdown-menu': GenericOrganizationComponentHook;
  240. 'sidebar:organization-dropdown-menu-bottom': GenericOrganizationComponentHook;
  241. };
  242. /**
  243. * Onboarding experience hooks
  244. */
  245. export type OnboardingHooks = {
  246. 'onboarding-wizard:skip-help': GenericOrganizationComponentHook;
  247. 'onboarding:block-hide-sidebar': () => boolean;
  248. 'onboarding:extra-chrome': GenericComponentHook;
  249. 'onboarding:targeted-onboarding-header': (opts: {source: string}) => React.ReactNode;
  250. };
  251. /**
  252. * Settings navigation hooks.
  253. */
  254. export type SettingsHooks = {
  255. 'settings:api-navigation-config': SettingsItemsHook;
  256. 'settings:organization-navigation': OrganizationSettingsHook;
  257. 'settings:organization-navigation-config': SettingsConfigHook;
  258. };
  259. /**
  260. * Feature Specific Hooks
  261. */
  262. export interface FeatureSpecificHooks extends SpendVisibilityHooks {}
  263. /**
  264. * Hooks related to Spend Visibitlity
  265. * (i.e. Per-Project Spike Protection + Spend Allocations)
  266. */
  267. export type SpendVisibilityHooks = {
  268. 'spend-visibility:spike-protection-project-settings': GenericProjectComponentHook;
  269. };
  270. /**
  271. * Hooks that are actually React Hooks as well
  272. */
  273. export type ReactHooks = {
  274. 'react-hook:route-activated': (
  275. props: RouteContextInterface
  276. ) => React.ContextType<typeof RouteAnalyticsContext>;
  277. 'react-hook:use-button-tracking': (props: ButtonProps) => () => void;
  278. 'react-hook:use-experiment': UseExperiment;
  279. };
  280. /**
  281. * Callback hooks.
  282. * These hooks just call a function that has no return value
  283. * and perform some sort of callback logic
  284. */
  285. type CallbackHooks = {
  286. 'callback:on-guide-update': GuideUpdateCallback;
  287. 'callback:on-monitor-created': MonitorCreatedCallback;
  288. };
  289. /**
  290. * Renders a React node with no props
  291. */
  292. type GenericComponentHook = () => React.ReactNode;
  293. /**
  294. * A route hook provides an injection point for a list of routes.
  295. */
  296. type RoutesHook = () => Route[];
  297. /**
  298. * Receives an organization object and should return a React node.
  299. */
  300. type GenericOrganizationComponentHook = (opts: {
  301. organization: Organization;
  302. }) => React.ReactNode;
  303. /**
  304. * Receives a project object and should return a React node.
  305. */
  306. type GenericProjectComponentHook = (opts: {project: Project}) => React.ReactNode;
  307. /**
  308. * A FeatureDisabledHook returns a react element when a feature is not enabled.
  309. */
  310. type FeatureDisabledHook = (opts: {
  311. /**
  312. * Children can either be a node, or a function that accepts a renderDisabled prop containing
  313. * a function/component to render when the feature is not enabled.
  314. */
  315. children: React.ReactNode | ChildrenRenderFn;
  316. /**
  317. * The list of features that are controlled by this hook.
  318. */
  319. features: string[];
  320. /**
  321. * Weather the feature is or is not enabled.
  322. */
  323. hasFeature: boolean;
  324. /**
  325. * The organization that is associated to this feature.
  326. */
  327. organization: Organization;
  328. /**
  329. * The project that is associated to this feature.
  330. */
  331. project?: Project;
  332. }) => React.ReactNode;
  333. /**
  334. * Called when the app is mounted.
  335. */
  336. type AnalyticsInitUser = (user: User) => void;
  337. /**
  338. * Trigger analytics tracking in the hook store.
  339. */
  340. type AnalyticsRawTrackEvent = (
  341. data: {
  342. /**
  343. * Arbitrary data to track
  344. */
  345. [key: string]: any;
  346. /**
  347. * The Reload event key.
  348. */
  349. eventKey: string;
  350. /**
  351. * The Amplitude event name. Set to null if event should not go to Amplitude.
  352. */
  353. eventName: string | null;
  354. /**
  355. * Organization to pass in. If full org object not available, pass in just the Id.
  356. * If no org, pass in null.
  357. */
  358. organization: Organization | string | null;
  359. },
  360. options?: {
  361. /**
  362. * An arbitrary function to map the parameters to new parameters
  363. */
  364. mapValuesFn?: (params: Record<string, any>) => Record<string, any>;
  365. /**
  366. * If true, starts an analytics session. This session can be used
  367. * to construct funnels. The start of the funnel should have
  368. * startSession set to true.
  369. */
  370. startSession?: boolean;
  371. /**
  372. * Optional unix timestamp
  373. */
  374. time?: number;
  375. }
  376. ) => void;
  377. /**
  378. * Trigger experiment observed logging.
  379. */
  380. type AnalyticsLogExperiment = (opts: {
  381. /**
  382. * The experiment key
  383. */
  384. key: ExperimentKey;
  385. /**
  386. * The organization. Must be provided for organization experiments.
  387. */
  388. organization?: Organization;
  389. }) => void;
  390. /**
  391. * Trigger recording a metric in the hook store.
  392. */
  393. type MetricsEvent = (
  394. /**
  395. * Metric name
  396. */
  397. name: string,
  398. /**
  399. * Value to record for this metric
  400. */
  401. value: number,
  402. /**
  403. * An additional tags object
  404. */
  405. tags?: object
  406. ) => void;
  407. /**
  408. * Provides additional navigation components
  409. */
  410. type OrganizationSettingsHook = (organization: Organization) => React.ReactElement;
  411. /**
  412. * Provides additional setting configurations
  413. */
  414. type SettingsConfigHook = (organization: Organization) => NavigationSection;
  415. /**
  416. * Provides additional setting navigation items
  417. */
  418. type SettingsItemsHook = (organization?: Organization) => NavigationItem[];
  419. /**
  420. * Each sidebar label is wrapped with this hook, to allow sidebar item
  421. * augmentation.
  422. */
  423. type SidebarItemLabelHook = () => React.ComponentType<{
  424. /**
  425. * The item label being wrapped
  426. */
  427. children: React.ReactNode;
  428. /**
  429. * The key of the item label currently being rendered. If no id is provided
  430. * the hook will have no effect.
  431. */
  432. id?: string;
  433. }>;
  434. type SidebarProps = Pick<
  435. React.ComponentProps<typeof SidebarItem>,
  436. 'orientation' | 'collapsed' | 'hasPanel'
  437. >;
  438. /**
  439. * Returns an additional list of sidebar items.
  440. */
  441. type SidebarBottomItemsHook = (
  442. opts: SidebarProps & {organization: Organization}
  443. ) => React.ReactNode;
  444. /**
  445. * Provides augmentation of the help modal footer
  446. */
  447. type HelpModalFooterHook = (opts: {
  448. closeModal: () => void;
  449. organization: Organization;
  450. }) => React.ReactNode;
  451. /**
  452. * The DecoratedIntegrationFeature differs from the IntegrationFeature as it is
  453. * expected to have been transformed into marked up content.
  454. */
  455. type DecoratedIntegrationFeature = {
  456. /**
  457. * Marked up description
  458. */
  459. description: React.ReactNode;
  460. featureGate: string;
  461. };
  462. type IntegrationFeatureGroup = {
  463. /**
  464. * The list of features within this group
  465. */
  466. features: DecoratedIntegrationFeature[];
  467. /**
  468. * Weather the group has all of the features enabled within this group
  469. * or not.
  470. */
  471. hasFeatures: boolean;
  472. };
  473. type FeatureGateSharedProps = {
  474. /**
  475. * The list of features, typically this is provided by the backend.
  476. */
  477. features: DecoratedIntegrationFeature[];
  478. /**
  479. * Organization of the integration we're querying feature gate details for.
  480. */
  481. organization: Organization;
  482. };
  483. type IntegrationFeaturesProps = FeatureGateSharedProps & {
  484. /**
  485. * The children function which will be provided with gating details.
  486. */
  487. children: (opts: {
  488. /**
  489. * Is the integration disabled for installation because of feature gating?
  490. */
  491. disabled: boolean;
  492. /**
  493. * The translated reason that the integration is disabled.
  494. */
  495. disabledReason: React.ReactNode;
  496. /**
  497. * Features grouped based on specific gating criteria (for example, in
  498. * sentry.io this is features grouped by plans).
  499. */
  500. gatedFeatureGroups: IntegrationFeatureGroup[];
  501. /**
  502. * This is the list of features which have *not* been gated in any way.
  503. */
  504. ungatedFeatures: DecoratedIntegrationFeature[];
  505. }) => React.ReactElement;
  506. };
  507. type IntegrationFeatureListProps = FeatureGateSharedProps & {
  508. provider: Pick<IntegrationProvider, 'key'>;
  509. };
  510. /**
  511. * The integration features gate hook provides components to customize
  512. * integration feature lists.
  513. */
  514. type IntegrationsFeatureGatesHook = () => {
  515. /**
  516. * This component renders the list of integration features.
  517. */
  518. FeatureList: React.ComponentType<IntegrationFeatureListProps>;
  519. /**
  520. * This is a render-prop style component that given a set of integration
  521. * features will call the children function with gating details about the
  522. * features.
  523. */
  524. IntegrationFeatures: React.ComponentType<IntegrationFeaturesProps>;
  525. };
  526. /**
  527. * Invite Button customization allows for a render-props component to replace
  528. * or intercept props of the button element.
  529. */
  530. type InviteButtonCustomizationHook = () => React.ComponentType<{
  531. children: (opts: {
  532. /**
  533. * Whether the Invite Members button is active or not
  534. */
  535. disabled: boolean;
  536. onTriggerModal: () => void;
  537. }) => React.ReactElement;
  538. onTriggerModal: () => void;
  539. organization: Organization;
  540. }>;
  541. /**
  542. * Invite Modal customization allows for a render-prop component to add
  543. * additional react elements into the modal, and add invite-send middleware.
  544. */
  545. type InviteModalCustomizationHook = () => React.ComponentType<{
  546. children: (opts: {
  547. /**
  548. * Indicates that the modal's send invites button should be enabled and
  549. * invites may currently be sent.
  550. */
  551. canSend: boolean;
  552. /**
  553. * Trigger sending invites
  554. */
  555. sendInvites: () => void;
  556. /**
  557. * Additional react elements to render in the header of the modal, just
  558. * under the description.
  559. */
  560. headerInfo?: React.ReactNode;
  561. }) => React.ReactElement;
  562. /**
  563. * When the children's sendInvites renderProp is called, this will also be
  564. * triggered.
  565. */
  566. onSendInvites: () => void;
  567. /**
  568. * The organization that members will be invited to.
  569. */
  570. organization: Organization;
  571. /**
  572. * Indicates if clicking 'send invites' will immediately send invites, or
  573. * would just create invite requests.
  574. */
  575. willInvite: boolean;
  576. }>;