import streamlit as st def render_metrics_summary(leads: list): total = len(leads) novos = sum(1 for l in leads if l.get('status_funil') == 'novo') contatados = sum(1 for l in leads if l.get('status_funil') == 'contatado') negociacao = sum(1 for l in leads if l.get('status_funil') == 'negociacao') ganhos = sum(1 for l in leads if l.get('status_funil') == 'ganho') taxa_conversao = (ganhos / total * 100) if total > 0 else 0.0 c1, c2, c3, c4, c5 = st.columns(5) with c1: st.markdown( f"""
Total de Leads
{total}
""", unsafe_allow_html=True ) with c2: st.markdown( f"""
Leads Novos
{novos}
""", unsafe_allow_html=True ) with c3: st.markdown( f"""
Em Negociação
{negociacao}
""", unsafe_allow_html=True ) with c4: st.markdown( f"""
Ganhos
{ganhos}
""", unsafe_allow_html=True ) with c5: st.markdown( f"""
Taxa Conversão
{taxa_conversao:.1f}%
""", unsafe_allow_html=True )