hooks.tsx 20 KB

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