File size: 950 Bytes
0f01ba2
c08b7b9
0f01ba2
c08b7b9
 
0f01ba2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c08b7b9
0f01ba2
 
c08b7b9
0f01ba2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#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