mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
* rename web to inspect ui * feat(sdk-android): add camelToSnakeCase conversion * feat(sdk-android): add snapshot() property delegate with tests * feat(folio): add feature-scoped sanderling snapshot objects * refactor(folio): slim FolioApplication to snapshot object references * fix(folio): rename route snapshot to screen, update spec.ts
33 lines
912 B
TypeScript
33 lines
912 B
TypeScript
import { BrowserRouter, Navigate, Route, Routes, useParams } from "react-router-dom";
|
|
import RunList from "./routes/RunList";
|
|
import RunDetail from "./routes/RunDetail";
|
|
|
|
function RunIndexRedirect() {
|
|
const { id } = useParams<{ id: string }>();
|
|
if (!id) {
|
|
return <NotFound />;
|
|
}
|
|
return <Navigate to={`/runs/${id}/steps/1`} replace />;
|
|
}
|
|
|
|
function NotFound() {
|
|
return <div className="status-block">not found</div>;
|
|
}
|
|
|
|
export default function App() {
|
|
return (
|
|
<BrowserRouter>
|
|
<div className="app-shell">
|
|
<main className="app-main">
|
|
<Routes>
|
|
<Route path="/" element={<RunList />} />
|
|
<Route path="/runs/:id" element={<RunIndexRedirect />} />
|
|
<Route path="/runs/:id/steps/:step" element={<RunDetail />} />
|
|
<Route path="*" element={<NotFound />} />
|
|
</Routes>
|
|
</main>
|
|
</div>
|
|
</BrowserRouter>
|
|
);
|
|
}
|