"""Sidebar component with persona selection and system status.""" import streamlit as st from config import APP_NAME, APP_VERSION, PERSONAS from data.synthetic import get_staff_metrics def render_sidebar() -> str: """Render the sidebar and return the selected persona key.""" with st.sidebar: st.markdown( f"
v{APP_VERSION} | HIPAA-Safe Demo
", unsafe_allow_html=True, ) st.divider() # Persona selector persona_labels = {v["label"]: k for k, v in PERSONAS.items()} selected_label = st.selectbox( "Switch Workspace", options=list(persona_labels.keys()), format_func=lambda x: f"{PERSONAS[persona_labels[x]]['icon']} {x}", ) persona_key = persona_labels[selected_label] st.caption(PERSONAS[persona_key]["description"]) st.divider() # System status st.markdown("**System Status**") staff = get_staff_metrics() st.metric( "Admin Burden Reduced", f"{staff['paperwork_mins_saved_today']} mins", staff["avg_documentation_time_delta"], ) st.success("QHIN Pipeline: Active", icon="✅") st.info("Agent Swarm: 6 Agents Online", icon="🤖") st.divider() # Compliance badges st.markdown("**Compliance**") st.markdown( 'HIPAA Compliant ' 'SOC 2 Type II', unsafe_allow_html=True, ) st.divider() st.caption( "All data shown is synthetic and for demonstration purposes only. " "No real PHI/PII is used in this application." ) return persona_key