Spaces:
Sleeping
Sleeping
File size: 890 Bytes
b0c6eb9 7ed05a1 |
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 |
# Paper list component
# File: components/paper_list.py
import streamlit as st
def render_paper_list(papers):
"""
Display a list of papers: title, authors, truncated abstract, and link if available.
"""
st.header("π Papers Found")
if not papers:
st.warning("No papers found. Try another query.")
return
for paper in papers:
title = paper.get("title", "Untitled")
authors = paper.get("authors", [])
abstract = paper.get("abstract", "No abstract.")
link = paper.get("url")
with st.expander(title, expanded=False):
st.markdown(f"**Authors:** {', '.join(authors)}")
# Truncate abstract to 300 chars
snippet = abstract if len(abstract) < 300 else abstract[:300] + "..."
st.write(snippet)
if link:
st.markdown(f"[Read more]({link})") |