@@ -12,6 +12,8 @@ import {
1212 NotificationCount ,
1313 InstallState ,
1414 StepChange ,
15+ IntervalType ,
16+ ReportName ,
1517} from '@stripe/connect-js' ;
1618
1719export type CommonComponentProps = {
@@ -649,3 +651,51 @@ export const ConnectTaxSettings = ({
649651
650652 return wrapper ;
651653} ;
654+
655+ export const ConnectReportingChart = ( {
656+ reportName,
657+ intervalStart,
658+ intervalEnd,
659+ intervalType,
660+ onLoadError,
661+ onLoaderStart,
662+ } : {
663+ /**
664+ * @param reportName The name of the report to render as a chart.
665+ * @param intervalStart The start date of the report interval.
666+ * @param intervalEnd The end date of the report interval.
667+ * @param intervalType The type of the report interval.
668+ */
669+ reportName : ReportName ;
670+ intervalStart ?: Date ;
671+ intervalEnd ?: Date ;
672+ intervalType ?: IntervalType ;
673+ } & CommonComponentProps ) : JSX . Element | null => {
674+ const { wrapper, component : reportingChart } =
675+ useCreateComponent ( 'reporting-chart' ) ;
676+
677+ useUpdateWithSetter ( reportingChart , reportName , ( comp , val ) =>
678+ comp . setReportName ( val )
679+ ) ;
680+
681+ useUpdateWithSetter ( reportingChart , intervalStart , ( comp , val ) =>
682+ comp . setIntervalStart ( val )
683+ ) ;
684+
685+ useUpdateWithSetter ( reportingChart , intervalEnd , ( comp , val ) =>
686+ comp . setIntervalEnd ( val )
687+ ) ;
688+
689+ useUpdateWithSetter ( reportingChart , intervalType , ( comp , val ) =>
690+ comp . setIntervalType ( val )
691+ ) ;
692+
693+ useUpdateWithSetter ( reportingChart , onLoaderStart , ( comp , val ) => {
694+ comp . setOnLoaderStart ( val ) ;
695+ } ) ;
696+ useUpdateWithSetter ( reportingChart , onLoadError , ( comp , val ) => {
697+ comp . setOnLoadError ( val ) ;
698+ } ) ;
699+
700+ return wrapper ;
701+ } ;
0 commit comments