diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts index e995bc5..35b4996 100644 --- a/frontend/src/routeTree.gen.ts +++ b/frontend/src/routeTree.gen.ts @@ -21,7 +21,9 @@ import { Route as AdminMediaRouteImport } from './routes/admin/media' import { Route as AdminRolesRouteImport } from './routes/admin/roles' import { Route as AdminShowsRouteImport } from './routes/admin/shows' import { Route as AdminUsersRouteImport } from './routes/admin/users' +import { Route as AdminChannelsIndexRouteImport } from './routes/admin/channels.index' import { Route as AdminChannelsChannelIdRouteImport } from './routes/admin/channels.$channelId' +import { Route as AdminShowsIndexRouteImport } from './routes/admin/shows.index' import { Route as AdminShowsShowIdRouteImport } from './routes/admin/shows.$showId' const IndexRoute = IndexRouteImport.update({ @@ -84,11 +86,21 @@ const AdminUsersRoute = AdminUsersRouteImport.update({ path: '/users', getParentRoute: () => AdminRoute, } as any) +const AdminChannelsIndexRoute = AdminChannelsIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => AdminChannelsRoute, +} as any) const AdminChannelsChannelIdRoute = AdminChannelsChannelIdRouteImport.update({ id: '/$channelId', path: '/$channelId', getParentRoute: () => AdminChannelsRoute, } as any) +const AdminShowsIndexRoute = AdminShowsIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => AdminShowsRoute, +} as any) const AdminShowsShowIdRoute = AdminShowsShowIdRouteImport.update({ id: '/$showId', path: '/$showId', @@ -110,6 +122,8 @@ export interface FileRoutesByFullPath { '/admin/': typeof AdminIndexRoute '/admin/channels/$channelId': typeof AdminChannelsChannelIdRoute '/admin/shows/$showId': typeof AdminShowsShowIdRoute + '/admin/channels/': typeof AdminChannelsIndexRoute + '/admin/shows/': typeof AdminShowsIndexRoute } export interface FileRoutesByTo { '/': typeof IndexRoute @@ -117,14 +131,14 @@ export interface FileRoutesByTo { '/login': typeof LoginRoute '/register': typeof RegisterRoute '/settings': typeof SettingsRoute - '/admin/channels': typeof AdminChannelsRouteWithChildren '/admin/media': typeof AdminMediaRoute '/admin/roles': typeof AdminRolesRoute - '/admin/shows': typeof AdminShowsRouteWithChildren '/admin/users': typeof AdminUsersRoute '/admin': typeof AdminIndexRoute '/admin/channels/$channelId': typeof AdminChannelsChannelIdRoute '/admin/shows/$showId': typeof AdminShowsShowIdRoute + '/admin/channels': typeof AdminChannelsIndexRoute + '/admin/shows': typeof AdminShowsIndexRoute } export interface FileRoutesById { __root__: typeof rootRouteImport @@ -142,6 +156,8 @@ export interface FileRoutesById { '/admin/': typeof AdminIndexRoute '/admin/channels/$channelId': typeof AdminChannelsChannelIdRoute '/admin/shows/$showId': typeof AdminShowsShowIdRoute + '/admin/channels/': typeof AdminChannelsIndexRoute + '/admin/shows/': typeof AdminShowsIndexRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath @@ -160,6 +176,8 @@ export interface FileRouteTypes { | '/admin/' | '/admin/channels/$channelId' | '/admin/shows/$showId' + | '/admin/channels/' + | '/admin/shows/' fileRoutesByTo: FileRoutesByTo to: | '/' @@ -167,14 +185,14 @@ export interface FileRouteTypes { | '/login' | '/register' | '/settings' - | '/admin/channels' | '/admin/media' | '/admin/roles' - | '/admin/shows' | '/admin/users' | '/admin' | '/admin/channels/$channelId' | '/admin/shows/$showId' + | '/admin/channels' + | '/admin/shows' id: | '__root__' | '/' @@ -191,6 +209,8 @@ export interface FileRouteTypes { | '/admin/' | '/admin/channels/$channelId' | '/admin/shows/$showId' + | '/admin/channels/' + | '/admin/shows/' fileRoutesById: FileRoutesById } export interface RootRouteChildren { @@ -288,6 +308,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AdminUsersRouteImport parentRoute: typeof AdminRoute } + '/admin/channels/': { + id: '/admin/channels/' + path: '/' + fullPath: '/admin/channels/' + preLoaderRoute: typeof AdminChannelsIndexRouteImport + parentRoute: typeof AdminChannelsRoute + } '/admin/channels/$channelId': { id: '/admin/channels/$channelId' path: '/$channelId' @@ -295,6 +322,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AdminChannelsChannelIdRouteImport parentRoute: typeof AdminChannelsRoute } + '/admin/shows/': { + id: '/admin/shows/' + path: '/' + fullPath: '/admin/shows/' + preLoaderRoute: typeof AdminShowsIndexRouteImport + parentRoute: typeof AdminShowsRoute + } '/admin/shows/$showId': { id: '/admin/shows/$showId' path: '/$showId' @@ -307,10 +341,12 @@ declare module '@tanstack/react-router' { interface AdminChannelsRouteChildren { AdminChannelsChannelIdRoute: typeof AdminChannelsChannelIdRoute + AdminChannelsIndexRoute: typeof AdminChannelsIndexRoute } const AdminChannelsRouteChildren: AdminChannelsRouteChildren = { AdminChannelsChannelIdRoute: AdminChannelsChannelIdRoute, + AdminChannelsIndexRoute: AdminChannelsIndexRoute, } const AdminChannelsRouteWithChildren = AdminChannelsRoute._addFileChildren( @@ -319,10 +355,12 @@ const AdminChannelsRouteWithChildren = AdminChannelsRoute._addFileChildren( interface AdminShowsRouteChildren { AdminShowsShowIdRoute: typeof AdminShowsShowIdRoute + AdminShowsIndexRoute: typeof AdminShowsIndexRoute } const AdminShowsRouteChildren: AdminShowsRouteChildren = { AdminShowsShowIdRoute: AdminShowsShowIdRoute, + AdminShowsIndexRoute: AdminShowsIndexRoute, } const AdminShowsRouteWithChildren = AdminShowsRoute._addFileChildren( diff --git a/frontend/src/routes/admin/channels.index.tsx b/frontend/src/routes/admin/channels.index.tsx new file mode 100644 index 0000000..34cdae0 --- /dev/null +++ b/frontend/src/routes/admin/channels.index.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from '@tanstack/react-router' +import { ChannelsPanel } from '@/features/admin/channels/ChannelsPanel' + +export const Route = createFileRoute('/admin/channels/')({ component: ChannelsPanel }) diff --git a/frontend/src/routes/admin/channels.tsx b/frontend/src/routes/admin/channels.tsx index 4b80cb2..400dc3a 100644 --- a/frontend/src/routes/admin/channels.tsx +++ b/frontend/src/routes/admin/channels.tsx @@ -1,4 +1,4 @@ -import { createFileRoute } from '@tanstack/react-router' -import { ChannelsPanel } from '@/features/admin/channels/ChannelsPanel' +import { createFileRoute, Outlet } from '@tanstack/react-router' -export const Route = createFileRoute('/admin/channels')({ component: ChannelsPanel }) +// Лейаут для /admin/channels/*: список — в index-роуте, деталь — в channels.$channelId. +export const Route = createFileRoute('/admin/channels')({ component: () => }) diff --git a/frontend/src/routes/admin/shows.index.tsx b/frontend/src/routes/admin/shows.index.tsx new file mode 100644 index 0000000..7edeb45 --- /dev/null +++ b/frontend/src/routes/admin/shows.index.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from '@tanstack/react-router' +import { ShowsPanel } from '@/features/admin/shows/ShowsPanel' + +export const Route = createFileRoute('/admin/shows/')({ component: ShowsPanel }) diff --git a/frontend/src/routes/admin/shows.tsx b/frontend/src/routes/admin/shows.tsx index 85153af..9d1afe6 100644 --- a/frontend/src/routes/admin/shows.tsx +++ b/frontend/src/routes/admin/shows.tsx @@ -1,4 +1,4 @@ -import { createFileRoute } from '@tanstack/react-router' -import { ShowsPanel } from '@/features/admin/shows/ShowsPanel' +import { createFileRoute, Outlet } from '@tanstack/react-router' -export const Route = createFileRoute('/admin/shows')({ component: ShowsPanel }) +// Лейаут для /admin/shows/*: список — в index-роуте, деталь — в shows.$showId. +export const Route = createFileRoute('/admin/shows')({ component: () => })