MCP_Research / components /notebook_view.py
mgbam's picture
Create notebook_view.py
3cc3626 verified
raw
history blame contribute delete
573 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}")