use-sidebar-data.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. import {
  2. LayoutDashboard,
  3. Activity,
  4. Key,
  5. FileText,
  6. Wallet,
  7. Box,
  8. Users,
  9. Ticket,
  10. User,
  11. Command,
  12. Radio,
  13. FlaskConical,
  14. MessageSquare,
  15. CreditCard,
  16. ListTodo,
  17. Settings,
  18. } from 'lucide-react'
  19. import { useTranslation } from 'react-i18next'
  20. import { WORKSPACE_IDS } from '@/components/layout/lib/workspace-registry'
  21. import { type SidebarData } from '@/components/layout/types'
  22. export function useSidebarData(): SidebarData {
  23. const { t } = useTranslation()
  24. return {
  25. workspaces: [
  26. {
  27. id: WORKSPACE_IDS.DEFAULT,
  28. name: '', // Dynamically fetches system name
  29. logo: Command,
  30. plan: '', // Dynamically fetches system version
  31. },
  32. ],
  33. navGroups: [
  34. {
  35. id: 'chat',
  36. title: t('Chat'),
  37. items: [
  38. {
  39. title: t('Playground'),
  40. url: '/playground',
  41. icon: FlaskConical,
  42. },
  43. {
  44. title: t('Chat'),
  45. icon: MessageSquare,
  46. type: 'chat-presets',
  47. },
  48. ],
  49. },
  50. {
  51. id: 'general',
  52. title: t('General'),
  53. items: [
  54. {
  55. title: t('Overview'),
  56. url: '/dashboard/overview',
  57. icon: Activity,
  58. },
  59. {
  60. title: t('Dashboard'),
  61. url: '/dashboard/models',
  62. icon: LayoutDashboard,
  63. },
  64. {
  65. title: t('API Keys'),
  66. url: '/keys',
  67. icon: Key,
  68. },
  69. {
  70. title: t('Usage Logs'),
  71. url: '/usage-logs/common',
  72. icon: FileText,
  73. },
  74. {
  75. title: t('Task Logs'),
  76. url: '/usage-logs/task',
  77. activeUrls: ['/usage-logs/drawing'],
  78. configUrls: ['/usage-logs/drawing', '/usage-logs/task'],
  79. icon: ListTodo,
  80. },
  81. ],
  82. },
  83. {
  84. id: 'personal',
  85. title: t('Personal'),
  86. items: [
  87. {
  88. title: t('Wallet'),
  89. url: '/wallet',
  90. icon: Wallet,
  91. },
  92. {
  93. title: t('Profile'),
  94. url: '/profile',
  95. icon: User,
  96. },
  97. ],
  98. },
  99. {
  100. id: 'admin',
  101. title: t('Admin'),
  102. items: [
  103. {
  104. title: t('Channels'),
  105. url: '/channels',
  106. icon: Radio,
  107. },
  108. {
  109. title: t('Models'),
  110. url: '/models/metadata',
  111. icon: Box,
  112. },
  113. {
  114. title: t('Users'),
  115. url: '/users',
  116. icon: Users,
  117. },
  118. {
  119. title: t('Redemption Codes'),
  120. url: '/redemption-codes',
  121. icon: Ticket,
  122. },
  123. {
  124. title: t('Subscription Management'),
  125. url: '/subscriptions',
  126. icon: CreditCard,
  127. },
  128. {
  129. title: t('System Settings'),
  130. url: '/system-settings/site',
  131. activeUrls: ['/system-settings'],
  132. icon: Settings,
  133. },
  134. ],
  135. },
  136. ],
  137. }
  138. }