/*
Copyright (C) 2023-2026 QuantumNous

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

For commercial licensing, please contact support@quantumnous.com
*/
import {
  // Activity,
  Box,
  // CreditCard,
  FileText,
  // FlaskConical,
  Key,
  LayoutDashboard,
  ListTodo,
  // MessageSquare,
  Radio,
  // ServerCog,
  Settings,
  // Ticket,
  User,
  Users,
  // Wallet,
} from 'lucide-react'
// import { useTranslation } from 'react-i18next'

import { type SidebarData } from '@/components/layout/types'
// import { ROLE } from '@/lib/roles'

/**
 * Root navigation groups for the application sidebar.
 *
 * These are shown when the URL does not match any nested sidebar view
 * registered in `layout/lib/sidebar-view-registry.ts`.
 */
export function useSidebarData(): SidebarData {
  // const { t } = useTranslation()

  return {
    navGroups: [
      // {
      //   id: 'chat',
      //   title: t('Chat'),
      //   items: [
      //     {
      //       title: t('Playground'),
      //       url: '/playground',
      //       icon: FlaskConical,
      //     },
      //     {
      //       title: t('Chat'),
      //       icon: MessageSquare,
      //       type: 'chat-presets',
      //     },
      //   ],
      // },
      {
        id: 'overview',
        title: '总览',
        items: [
          {
            title: '数据看板',
            url: '/dashboard/models',
            icon: LayoutDashboard,
          },
        ],
      },
      {
        id: 'admin',
        title: '平台管理',
        items: [
          {
            title: '渠道管理',
            url: '/channels',
            icon: Radio,
          },
          {
            title: '用户管理',
            url: '/users',
            icon: Users,
          },
          // {
          //   title: t('Models'),
          //   url: '/models/metadata',
          //   icon: Box,
          // },
          // {
          //   title: t('Redemption Codes'),
          //   url: '/redemption-codes',
          //   icon: Ticket,
          // },
          // {
          //   title: t('Subscriptions'),
          //   url: '/subscriptions',
          //   icon: CreditCard,
          // },
          // {
          //   title: t('System Info'),
          //   url: '/system-info',
          //   icon: ServerCog,
          //   requiredRole: ROLE.SUPER_ADMIN,
          // },
        ],
      },
      {
        id: 'personal-management',
        title: '个人管理',
        items: [
          {
            title: '个人信息',
            url: '/profile',
            icon: User,
          },
          {
            title: 'API密钥',
            url: '/keys',
            icon: Key,
          },
          {
            title: '模型广场',
            url: '/pricing',
            icon: Box,
          },
          // {
          //   title: t('Wallet'),
          //   url: '/wallet',
          //   icon: Wallet,
          // },
        ],
      },
      {
        id: 'statistics-analysis',
        title: '统计分析',
        items: [
          {
            title: '使用日志',
            url: '/usage-logs/common',
            icon: FileText,
          },
          {
            title: '任务日志',
            url: '/usage-logs/task',
            activeUrls: ['/usage-logs/drawing'],
            configUrls: ['/usage-logs/drawing', '/usage-logs/task'],
            icon: ListTodo,
          },
        ],
      },
      {
        id: 'admin-system',
        title: '系统管理',
        items: [
          {
            title: '系统设置',
            url: '/system-settings/site',
            activeUrls: ['/system-settings'],
            icon: Settings,
          },
        ],
      },
    ],
  }
}
