Drop files here
or click to upload
import streamlit as st
# Simulación de tareas
tasks = [
{"id": 1, "title": "Update Sales Dashboard", "status": "Pending", "details": "Add Q3 data and refresh filters.", "assigned_to": ""},
{"id": 2, "title": "Customer Segmentation Model", "status": "In Review", "details": "Validate clustering logic and retrain with new data.", "assigned_to": ""},
{"id": 3, "title": "ETL Pipeline Optimization", "status": "Pending", "details": "Improve load time and error handling for monthly jobs.", "assigned_to": ""},
]
# Estado de selección
if "selected_task_id" not in st.session_state:
st.session_state.selected_task_id = None
st.title("🧾 Task Manager")
# Panel dividido
col1, col2 = st.columns([1, 2])
# Panel izquierdo: lista de tarjetas
with col1:
st.header("📋 Pending Tasks")
for task in tasks:
with st.container(border=True):
st.write(f':red-badge[tasks]')
if st.button(f"View Details", key=f"view_{task['id']}"):
st.session_state.selected_task_id = task["id"]
# Panel derecho: detalles de la tarea seleccionada
with col2:
st.header("🔍 Task Details")
selected = next((t for t in tasks if t["id"] == st.session_state.selected_task_id), None)
if selected:
st.markdown(f"### {selected['title']}")
st.markdown(f"**Status:** {selected['status']}")
st.markdown(f"**Details:** {selected['details']}")
assigned = st.text_input("Assign to:", value=selected["assigned_to"])
if st.button("Assign", key=f"assign_{selected['id']}"):
selected["assigned_to"] = assigned
st.success(f"Assigned to {assigned}")
else:
st.info("Select a task from the left to view details.")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?