From 41cd98e9960dffc4f17a64662a050ab62f5ec76b Mon Sep 17 00:00:00 2001 From: Yousef Moazzam Date: Wed, 24 Jun 2026 11:59:18 +0100 Subject: [PATCH] Add minimal session selector component --- frontend/unified/src/App.tsx | 7 +- .../src/components/SessionSelector.tsx | 66 +++++++++++++++++++ 2 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 frontend/unified/src/components/SessionSelector.tsx diff --git a/frontend/unified/src/App.tsx b/frontend/unified/src/App.tsx index 961117e..b5152e5 100644 --- a/frontend/unified/src/App.tsx +++ b/frontend/unified/src/App.tsx @@ -1,4 +1,5 @@ import { Box, Divider, Grid2 as Grid, Stack, Typography } from "@mui/material"; +import { SessionSelector } from "./components/SessionSelector"; const VERTICAL_SPACING = 2; const HORIZONTAL_SPACING = 2; @@ -9,11 +10,7 @@ export const App: React.FC = () => { Session - + Scan { + // TODO: initial value based on fetching latest session associated with logged-in user + const [session] = useState("latest-session"); + // TODO: initial value based on the initial session + const [beamline] = useState("Beamline: depends-on-session"); + const [sessionSelectionMode, setSessionSelectionMode] = + useState(SessionSelectionMode.Latest); + const [textInputValue, setTextInputValue] = useState(""); + + return ( + + { + if (toggleButtonLabel === SessionSelectionMode.Latest) { + setSessionSelectionMode(SessionSelectionMode.Latest); + } else if (toggleButtonLabel === SessionSelectionMode.Custom) { + setSessionSelectionMode(SessionSelectionMode.Custom); + } + }} + > + + {SessionSelectionMode.Latest} + + + {SessionSelectionMode.Custom} + + + ) => { + setTextInputValue(e.currentTarget.value); + }} + /> + + + ); +};