This commit is contained in:
2025-09-05 03:11:09 -04:00
parent fdefdbd12e
commit 0dbcc1a59d
5 changed files with 14 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
import {BrowserRouter, Route, Routes, Navigate} from 'react-router-dom';
import {ProtectedRoute} from 'components';
import {LoginForm, ChannelList} from 'views';
import {LoginForm, ChannelList, ChannelDetail} from 'views';
export default function Router() {
return (
@@ -12,7 +12,7 @@ export default function Router() {
{/* Protected routes */}
<Route path="/" element={<Navigate to="/channels" replace />} />
<Route path="/channels" element={<ProtectedRoute component={<ChannelList />} />} />
<Route path="/channels/:channelId" element={<ProtectedRoute component={<ChannelDetail />} />} />
{/* Fallback route */}
<Route path="*" element={<Navigate to="/login" replace />} />
</Routes>

View File

@@ -0,0 +1,5 @@
import { JSX } from 'react';
export function ChannelDetail(): JSX.Element {
return <div>ChannelDetail</div>;
}

View File

@@ -0,0 +1 @@
export * from './ChannelDetail';

View File

@@ -102,12 +102,14 @@ export const ChannelList = (): React.JSX.Element => {
);
}
if (isFetching) {
return <ChannelListLoading />;
}
return (
<div>
<Body className="table-container">
{isFetching ? (
<ChannelListLoading />
) : channels.length === 0 ? (
{channels.length === 0 ? (
<Main>
<div style={{textAlign: 'center', padding: '2rem'}}>
<h3>No channels found</h3>

View File

@@ -1,2 +1,3 @@
export * from './LoginForm';
export * from './ChannelList';
export * from './ChannelDetail';