feat: implementada funcionalidade de exclusao de leads via API e botoes na interface (Kanban, Tabela Analitica e Modal)

This commit is contained in:
2026-08-26 18:29:11 -03:00
parent 1513c65056
commit 1bfb89626f
5 changed files with 53 additions and 11 deletions
+14 -4
View File
@@ -65,22 +65,32 @@ def render_lead_detail_modal(lead_id: str, api_client: APIClient):
new_notes = st.text_area("Notas / Observações Comerciais:", value=lead_detail.get('notas', ''), height=120)
c_save, c_opt, c_close = st.columns([1, 1, 1])
c_save, c_opt, c_del, c_close = st.columns([1, 1, 1, 1])
with c_save:
if st.button("💾 Salvar Notas"):
if st.button("💾 Salvar Notas", use_container_width=True):
api_client.update_lead(lead_id, {'notas': new_notes})
st.success("Notas atualizadas!")
st.rerun()
with c_opt:
if st.button("🚫 Opt-Out (LGPD)", help="Marcar lead para não contatar"):
if st.button("🚫 Opt-Out (LGPD)", help="Marcar lead para não contatar", use_container_width=True):
api_client.opt_out_lead(lead_id)
st.warning("Lead marcado como Opt-Out LGPD.")
st.session_state.pop('selected_lead_id', None)
st.rerun()
with c_del:
if st.button("🗑️ Deletar Lead", type="primary", help="Excluir lead permanentemente do banco", use_container_width=True):
ok, msg = api_client.delete_lead(lead_id)
if ok:
st.success(msg)
else:
st.error(msg)
st.session_state.pop('selected_lead_id', None)
st.rerun()
with c_close:
if st.button("❌ Fechar"):
if st.button("❌ Fechar", use_container_width=True):
st.session_state.pop('selected_lead_id', None)
st.rerun()