Spaces:
Sleeping
Sleeping
File size: 1,114 Bytes
b0c6eb9 f3bb50e |
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 |
# Sidebar component
# File: components/sidebar.py
import streamlit as st
def render_sidebar():
"""
Display the sidebar UI for user query input.
Returns:
query (str): The research query text.
search_clicked (bool): Whether the search button was clicked.
"""
st.sidebar.header("π Research Query")
query = st.sidebar.text_input("Enter your research topic:", "")
search_clicked = st.sidebar.button("Search")
return query, search_clicked
# File: components/paper_list.py
import streamlit as st
def render_paper_list(papers):
"""
Display a list of papers with titles, authors, and abstracts.
Args:
papers (List[dict]): Each dict should have 'id', 'title', 'authors', 'abstract'.
"""
st.header("π Papers Found")
if not papers:
st.info("No papers found for this query.")
return
for paper in papers:
with st.expander(paper.get("title", "Unknown Title")):
st.markdown(f"**Authors:** {', '.join(paper.get('authors', []))}")
st.write(paper.get("abstract", "No abstract available.")) |