accounts-frontend/packages/app/containers/AuthFlowRoute.tsx
ErickSkrauch af59cc033f
Extract device code into a separate view.
Convert more components from class components to functional.
Fix invalid finish state when client was auto approved
2024-12-14 13:16:29 +01:00

18 lines
573 B
TypeScript

import React, { FC, ComponentType } from 'react';
import { Route, RouteProps, RouteComponentProps } from 'react-router-dom';
import AuthFlowRouteContents from './AuthFlowRouteContents';
// Make "component" prop required
type Props = Omit<RouteProps, 'component'> & {
component: ComponentType<RouteComponentProps>;
};
const AuthFlowRoute: FC<Props> = ({ component: Component, ...props }) => {
return (
<Route {...props} render={(routerProps) => <AuthFlowRouteContents component={Component} {...routerProps} />} />
);
};
export default AuthFlowRoute;