From f8e498557e848f29eb041975d386a51e669a119e Mon Sep 17 00:00:00 2001 From: Kai Chappell Date: Mon, 14 Apr 2025 20:16:52 +0000 Subject: [PATCH] add dashboard layout and routing --- dashboard/src/App.tsx | 33 +++++++++++++++++++ dashboard/src/components/layout/Header.tsx | 30 ++++++++++++++++++ dashboard/src/components/layout/Layout.tsx | 17 ++++++++++ dashboard/src/components/layout/Sidebar.tsx | 35 +++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 dashboard/src/App.tsx create mode 100644 dashboard/src/components/layout/Header.tsx create mode 100644 dashboard/src/components/layout/Layout.tsx create mode 100644 dashboard/src/components/layout/Sidebar.tsx diff --git a/dashboard/src/App.tsx b/dashboard/src/App.tsx new file mode 100644 index 0000000..c0b33f6 --- /dev/null +++ b/dashboard/src/App.tsx @@ -0,0 +1,33 @@ +import { BrowserRouter, Routes, Route } from 'react-router-dom'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { Layout } from './components/layout/Layout'; +import { ReviewsPage } from './pages/ReviewsPage'; +import { ReviewDetailPage } from './pages/ReviewDetailPage'; +import { MetricsPage } from './pages/MetricsPage'; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: 30 * 1000, + retry: 1, + }, + }, +}); + +function App() { + return ( + + + + }> + } /> + } /> + } /> + + + + + ); +} + +export default App; diff --git a/dashboard/src/components/layout/Header.tsx b/dashboard/src/components/layout/Header.tsx new file mode 100644 index 0000000..7b93e51 --- /dev/null +++ b/dashboard/src/components/layout/Header.tsx @@ -0,0 +1,30 @@ +import { Link } from 'react-router-dom'; + +export function Header() { + return ( +
+
+ +
+ A +
+ Arbiter + + +
+
+ ); +} diff --git a/dashboard/src/components/layout/Layout.tsx b/dashboard/src/components/layout/Layout.tsx new file mode 100644 index 0000000..d50c0e3 --- /dev/null +++ b/dashboard/src/components/layout/Layout.tsx @@ -0,0 +1,17 @@ +import { Outlet } from 'react-router-dom'; +import { Header } from './Header'; +import { Sidebar } from './Sidebar'; + +export function Layout() { + return ( +
+
+
+ +
+ +
+
+
+ ); +} diff --git a/dashboard/src/components/layout/Sidebar.tsx b/dashboard/src/components/layout/Sidebar.tsx new file mode 100644 index 0000000..d89f5bb --- /dev/null +++ b/dashboard/src/components/layout/Sidebar.tsx @@ -0,0 +1,35 @@ +import { NavLink } from 'react-router-dom'; + +const navItems = [ + { to: '/', label: 'Reviews', icon: '📋' }, + { to: '/metrics', label: 'Metrics', icon: '📊' }, +]; + +export function Sidebar() { + return ( + + ); +}