mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Refactor app structure
This commit is contained in:
parent
06b0fed11d
commit
d748372a28
23 changed files with 88 additions and 42 deletions
19
src/components/router/AsyncRoute.tsx
Normal file
19
src/components/router/AsyncRoute.tsx
Normal file
|
@ -0,0 +1,19 @@
|
|||
import React from 'react';
|
||||
import { Route } from 'react-router-dom';
|
||||
|
||||
import AsyncPage from '../AsyncPage';
|
||||
|
||||
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} />}
|
||||
/>
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue