fix(tabbar): exportar junto a filtros, tab bar sin scroll

- Botón Exportar movido junto a los filtros (misma fila)
- Tab bar solo tiene pestañas + botón Kanban (sin exportar)
- Sin scroll horizontal necesario
This commit is contained in:
2026-09-08 09:18:31 +00:00
parent 350455ddba
commit 3e9417667e

View File

@@ -510,14 +510,12 @@ function TabsCrm({
onCambiar,
vistaKanban,
onToggleKanban,
onExportar,
}: {
activa: TabCrm
conteos: Record<TabCrm, number>
onCambiar: (tab: TabCrm) => void
vistaKanban: boolean
onToggleKanban: () => void
onExportar?: () => void
}) {
const tabs: { id: TabCrm; titulo: string }[] = [
{ id: 'leads', titulo: 'Leads' },
@@ -552,15 +550,6 @@ function TabsCrm({
})}
{activa !== 'tablero' && (
<div className="ml-auto flex gap-1">
{onExportar && (
<button
type="button"
onClick={onExportar}
className="shrink-0 rounded-lg border border-[#D1D5DB] bg-white px-2 py-1 text-[11px] font-medium text-[#374151] shadow-sm transition-all hover:bg-[#F9FAFB] dark:border-[#334155] dark:bg-[#0F172A] dark:text-[#CBD5E1] dark:hover:bg-[#1E293B]"
>
📥 Exportar
</button>
)}
<button
type="button"
onClick={onToggleKanban}
@@ -1049,16 +1038,26 @@ export default function MiDiaPage({ accionesSesion }: { accionesSesion: Acciones
onCambiar={setTabCrm}
vistaKanban={vistaKanban}
onToggleKanban={() => setVistaKanban(!vistaKanban)}
onExportar={
tabCrm === 'leads' ? () => exportarLeads(resumen.misLeads.filter((l) => l.fuente === 'lead')) :
tabCrm === 'oportunidades' ? () => exportarOportunidades(resumen.misOportunidades.items) :
tabCrm === 'apartados' ? () => exportarApartados(resumen.misApartados) :
undefined
}
/>
{tabCrm !== 'tablero' && (
<div className="flex items-center gap-2">
<div className="flex-1">
<FiltrosAvanzados valor={filtros} onChange={setFiltros} />
</div>
<button
type="button"
onClick={() => {
if (tabCrm === 'leads') exportarLeads(resumen.misLeads.filter((l) => l.fuente === 'lead'))
else if (tabCrm === 'oportunidades') exportarOportunidades(resumen.misOportunidades.items)
else if (tabCrm === 'apartados') exportarApartados(resumen.misApartados)
}}
className="shrink-0 rounded-lg border border-[#D1D5DB] bg-white px-3 py-2 text-xs font-medium text-[#374151] shadow-sm transition-all hover:bg-[#F9FAFB] dark:border-[#334155] dark:bg-[#0F172A] dark:text-[#CBD5E1] dark:hover:bg-[#1E293B]"
>
📥 Exportar
</button>
</div>
)}
{tabCrm === 'leads' && (() => {