Files
CRM_AGENTES_CARGA/frontend/src/lib/components/sidebar/modules.ts
Ernesto Herrera e09cb02b8b feat(crm): cotización — Ver PDF, Enviar por correo y pantalla de marca por tenant
- Cliente API: quotesAPI.pdfUrl/sendEmail + quoteSettingsAPI (get/save/uploadLogo).
- Cotización: botones Ver PDF y Enviar por correo (modal con destinatario/asunto/mensaje).
- Configuración → Formato de cotización: emisor, logo, color, prefijo y textos por
  defecto (por compañía).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 13:22:24 -06:00

124 lines
2.8 KiB
TypeScript

import {
LayoutDashboard,
Settings2,
Users,
Shield,
Briefcase,
Ship,
Receipt,
Building,
} from '@lucide/svelte';
export type SystemContext = 'fixed_asset' | 'inventory';
export interface NavItem {
title: string;
url: string;
permission?: string;
systemContext?: SystemContext;
}
export interface NavMainItem {
title: string;
url: string;
icon: any;
isActive?: boolean;
permission?: string;
items?: NavItem[];
}
/**
* Navegación principal del dashboard.
* Agrega aquí los módulos de tu proyecto.
*/
export function getNavMain(): NavMainItem[] {
return [
{
title: 'Dashboard',
url: '/dashboard',
icon: LayoutDashboard,
},
{
title: 'CRM',
url: '/dashboard/crm',
icon: Briefcase,
items: [
{ title: 'Panel', url: '/dashboard/crm' },
{ title: 'Clientes / Prospectos', url: '/dashboard/crm/cuentas' },
{ title: 'Proveedores', url: '/dashboard/crm/proveedores' },
{ title: 'Contactos', url: '/dashboard/crm/contactos' },
{ title: 'Solicitudes', url: '/dashboard/crm/solicitudes' },
{ title: 'Cotizaciones', url: '/dashboard/crm/cotizaciones' },
{ title: 'Tarifarios', url: '/dashboard/crm/tarifarios' },
{ title: 'Cotizador', url: '/dashboard/crm/cotizador' },
{ title: 'Prospectos (embudo)', url: '/dashboard/crm/prospectos' },
{ title: 'Oportunidades', url: '/dashboard/crm/oportunidades' },
{ title: 'Actividades', url: '/dashboard/crm/actividades' },
{ title: 'Catálogos', url: '/dashboard/crm/catalogos' },
],
},
{
title: 'Operaciones',
url: '/dashboard/ops/embarques',
icon: Ship,
items: [
{ title: 'Embarques', url: '/dashboard/ops/embarques' },
],
},
{
title: 'Facturación',
url: '/dashboard/fin/facturas',
icon: Receipt,
items: [
{ title: 'Facturas y cobranza', url: '/dashboard/fin/facturas' },
],
},
{
title: 'Compañías',
url: '/dashboard/companias',
icon: Building,
},
{
title: 'Usuarios',
url: '/dashboard/users',
icon: Users,
},
{
title: 'Roles y permisos',
url: '/dashboard/roles',
icon: Shield,
},
{
title: 'Configuración',
url: '/dashboard/settings/general',
icon: Settings2,
items: [
{ title: 'General', url: '/dashboard/settings/general' },
{ title: 'Formato de cotización', url: '/dashboard/settings/cotizacion' },
],
},
];
}
/**
* Datos completos del sidebar (navegación + usuario fallback + proyectos).
* El usuario real se inyecta desde page.data en app-sidebar.svelte.
*/
export function getSidebarData() {
return {
navMain: getNavMain(),
projects: [] as { name: string; url: string; icon: any }[],
user: {
name: '',
email: '',
username: '',
firstName: null,
lastName: null,
displayName: '',
avatarUrl: null,
workspaceAvatarUrl: null,
legacyAvatarUrl: null,
},
};
}