app-sidebar.tsx 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. "use client"
  2. import { ChevronUp, Home, FileText, Settings, FileSignature, Send } from "lucide-react"
  3. import {
  4. DropdownMenu,
  5. DropdownMenuContent,
  6. DropdownMenuItem,
  7. DropdownMenuTrigger,
  8. } from "@/components/ui/dropdown-menu"
  9. import {
  10. Sidebar,
  11. SidebarContent,
  12. SidebarFooter,
  13. SidebarGroup,
  14. SidebarGroupContent,
  15. SidebarGroupLabel,
  16. SidebarHeader,
  17. SidebarMenu,
  18. SidebarMenuButton,
  19. SidebarMenuItem,
  20. SidebarProvider,
  21. SidebarTrigger,
  22. } from "@/components/ui/sidebar"
  23. import { ModeToggle } from "@/components/mode-toggle"
  24. // Menu items
  25. const items = [
  26. {
  27. title: "Inicio",
  28. url: "/",
  29. icon: Home,
  30. },
  31. {
  32. title: "Crear Factura (XML)",
  33. url: "/factura",
  34. icon: FileText,
  35. },
  36. {
  37. title: "Firmar Factura (XML)",
  38. url: "/firmar",
  39. icon: FileSignature,
  40. },
  41. {
  42. title: "Enviar al SRI (SOAP)",
  43. url: "/enviar-sri",
  44. icon: Send,
  45. },
  46. {
  47. title: "Configuración",
  48. url: "/configuracion",
  49. icon: Settings,
  50. },
  51. ]
  52. export function AppSidebar() {
  53. return (
  54. <Sidebar>
  55. <SidebarHeader>
  56. <SidebarMenu>
  57. <SidebarMenuItem>
  58. <SidebarMenuButton size="lg" className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground">
  59. <div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-red-500 text-sidebar-primary-foreground">
  60. <FileText className="size-4" />
  61. </div>
  62. <div className="grid flex-1 text-left text-sm leading-tight">
  63. <span className="truncate font-semibold">sumire</span>
  64. <span className="truncate text-xs">Sistema de Facturación</span>
  65. </div>
  66. </SidebarMenuButton>
  67. </SidebarMenuItem>
  68. </SidebarMenu>
  69. </SidebarHeader>
  70. <SidebarContent>
  71. <SidebarGroup>
  72. <SidebarGroupLabel>Navegación</SidebarGroupLabel>
  73. <SidebarGroupContent>
  74. <SidebarMenu>
  75. {items.map((item) => (
  76. <SidebarMenuItem key={item.title}>
  77. <SidebarMenuButton asChild>
  78. <a href={item.url}>
  79. <item.icon />
  80. <span>{item.title}</span>
  81. </a>
  82. </SidebarMenuButton>
  83. </SidebarMenuItem>
  84. ))}
  85. </SidebarMenu>
  86. </SidebarGroupContent>
  87. </SidebarGroup>
  88. </SidebarContent>
  89. <SidebarFooter>
  90. <SidebarMenu>
  91. <SidebarMenuItem>
  92. <div className="flex items-center justify-between w-full px-2 py-1">
  93. <div className="grid flex-1 text-left text-sm leading-tight">
  94. <span className="truncate font-semibold">Tema</span>
  95. <span className="truncate text-xs">Cambiar modo</span>
  96. </div>
  97. <ModeToggle />
  98. </div>
  99. </SidebarMenuItem>
  100. <SidebarMenuItem>
  101. <DropdownMenu>
  102. <DropdownMenuTrigger asChild>
  103. {/* <SidebarMenuButton
  104. size="sm"
  105. className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
  106. >
  107. <div className="grid flex-1 text-left text-sm leading-tight">
  108. <span className="truncate font-semibold">Usuario</span>
  109. <span className="truncate text-xs">usuario@ejemplo.com</span>
  110. </div>
  111. <ChevronUp className="ml-auto transition-transform group-data-[state=open]/dropdown-menu:rotate-180" />
  112. </SidebarMenuButton> */}
  113. </DropdownMenuTrigger>
  114. <DropdownMenuContent
  115. side="top"
  116. className="w-[--radix-popper-anchor-width]"
  117. >
  118. <DropdownMenuItem>
  119. <span>Mi Cuenta</span>
  120. </DropdownMenuItem>
  121. <DropdownMenuItem>
  122. <span>Configuración</span>
  123. </DropdownMenuItem>
  124. <DropdownMenuItem>
  125. <span>Cerrar Sesión</span>
  126. </DropdownMenuItem>
  127. </DropdownMenuContent>
  128. </DropdownMenu>
  129. </SidebarMenuItem>
  130. </SidebarMenu>
  131. </SidebarFooter>
  132. </Sidebar>
  133. )
  134. }