MCP_Research / component /notebook_view.py
mgbam's picture
Update component/notebook_view.py
75e32f7 verified
raw
history blame
574 Bytes
# File: components/notebook_view.py
import streamlit as st
def render_notebook(cells):
"""
Render reproducible code cells with run buttons.
"""
st.header("πŸ““ Reproducible Notebook")
if not cells:
st.info("No notebook cells available.")
return
for idx, cell in enumerate(cells, 1):
st.subheader(f"Cell {idx}")
st.code(cell, language='python')
if st.button(f"Run Cell {idx}", key=f"run_{idx}"):
# Placeholder: In practice this would execute via MCP
st.success(f"Executed cell {idx}")