1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/components/router/AsyncRoute.tsx

20 lines
471 B
TypeScript
Raw Normal View History

2022-11-01 16:41:09 -04:00
import React from 'react';
import { Route } from 'react-router-dom';
2023-04-27 17:04:33 -04:00
import AsyncPage from '../AsyncPage';
2022-11-01 16:41:09 -04:00
export interface AsyncRoute {
/** The URL path for this route. */
path: string
/** The relative path to the page component in the routes directory. */
page: string
}
export const toAsyncPageRoute = (route: AsyncRoute) => (
<Route
key={route.path}
path={route.path}
element={<AsyncPage page={route.page} />}
/>
);