mgbam's picture
Update components/sidebar.py
0f01ba2 verified
raw
history blame
950 Bytes
#components/sidebar.py
import streamlit as st
def render_sidebar():
"""
Render the sidebar controls for the research companion app.
Returns:
query (str): The user's search query.
num_results (int): Maximum number of papers to display.
theme (str): UI theme selection ('Light' or 'Dark').
search_clicked (bool): True if the Search button was pressed.
"""
st.sidebar.title("πŸ” Research Companion")
# Input for research topic
query = st.sidebar.text_input(
label="Enter your research topic:",
value="",
placeholder="e.g. CRISPR delivery"
)
# Slider for number of results
num_results = st.sidebar.slider(
label="Max papers to display",
min_value=1,
max_value=20,
value=5
)
# Theme selection
theme = st.sidebar.selectbox(
label="Theme:",
options=["Light", "Dark"],
index=0
)
# Search action
search_clicked = st.sidebar.button("Search")
return query, num_results, theme, search_clicked