/*
Copyright (C) 2025 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 .
For commercial licensing, please contact support@quantumnous.com
*/
import React, { useContext } from 'react';
import { Navigate, useLocation, useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { BrainCircuit, Image, Video } from 'lucide-react';
import { StatusContext } from '../../context/Status';
import PageBackground from '../../components/common/PageBackground';
import TextModel from './components/TextModel';
import ImageGeneration from './components/ImageGeneration';
import VideoGeneration from './components/VideoGeneration';
import KeyManagement from './components/KeyManagement';
import ExperienceSidebar from './components/ExperienceSidebar';
import CloudBrain from '../CloudBrain';
import { CLOUD_BRAIN_UI_ENABLED } from '../../config/cloudBrainUi';
import Loading from '../../components/common/ui/Loading';
import { DEFAULT_LOGIN_REDIRECT } from '../../helpers/data';
import {
EXPERIENCE_MODULES,
useExperienceModules,
} from './useExperienceModules';
// 移动端底部导航组件
const MobileBottomNav = ({ currentPath, navigate, isAvailable }) => {
const { t } = useTranslation();
// 与桌面侧边栏共用 useExperienceModules 判定,运营关闭的子页两端一致隐藏
const navItems = [
{
key: 'cloud-brain',
configKey: 'cloudBrain',
icon: BrainCircuit,
label: t('云端大脑'),
path: '/experience-center/cloud-brain',
gradient: 'from-emerald-600 to-orange-500',
beta: true,
},
{
key: 'image',
configKey: 'imageGeneration',
icon: Image,
label: t('图片'),
path: '/experience-center/image-generation',
gradient: 'from-pink-500 to-rose-600',
},
{
key: 'video',
configKey: 'videoGeneration',
icon: Video,
label: t('视频'),
path: '/experience-center/video-generation',
gradient: 'from-cyan-500 to-blue-600',
},
].filter((item) => isAvailable(item.configKey));
return (