2024-12-11 01:12:06 +05:30
|
|
|
import React, { FC } from 'react';
|
2019-12-07 16:58:52 +05:30
|
|
|
import { Route, RouteProps } from 'react-router-dom';
|
|
|
|
|
|
|
|
import AuthFlowRouteContents from './AuthFlowRouteContents';
|
|
|
|
|
2024-12-11 01:12:06 +05:30
|
|
|
// Make "component" prop required
|
|
|
|
type Props = Omit<RouteProps, 'component'> & Required<Pick<RouteProps, 'component'>>;
|
2019-12-10 13:17:32 +05:30
|
|
|
|
2024-12-11 01:12:06 +05:30
|
|
|
const AuthFlowRoute: FC<Props> = ({ component: Component, ...props }) => {
|
2020-05-24 04:38:24 +05:30
|
|
|
return (
|
|
|
|
<Route
|
2024-12-11 01:12:06 +05:30
|
|
|
{...props}
|
2020-05-24 04:38:24 +05:30
|
|
|
render={(routerProps) => <AuthFlowRouteContents routerProps={routerProps} component={Component} />}
|
2019-12-07 16:58:52 +05:30
|
|
|
/>
|
2020-05-24 04:38:24 +05:30
|
|
|
);
|
2024-12-11 01:12:06 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export default AuthFlowRoute;
|