// Author: fruit.com.cn import { Suspense, useState } from 'react'; import { Link, Outlet, useLocation } from 'react-router-dom'; import { useLocale, useUi } from '../app/providers/AppProviders'; import { Sidebar } from './components/Sidebar'; import { TopBar } from './components/TopBar'; import { UploadVideoDialog } from './components/UploadVideoDialog'; const FOOTER_LINKS = { id: { privacy: 'Privasi', terms: 'Ketentuan', about: 'Tentang YMB' }, en: { privacy: 'Privacy', terms: 'Terms', about: 'About YMB' }, zh: { privacy: '隐私政策', terms: '服务条款', about: '关于 YMB' }, }; export function AppShell() { const { locale } = useLocale(); const { sidebarOpen, setSidebarOpen } = useUi(); const location = useLocation(); const [uploadOpen, setUploadOpen] = useState(false); const immersive = location.pathname === '/shorts'; const links = FOOTER_LINKS[locale.code] || FOOTER_LINKS.en; return ( <> setSidebarOpen(!sidebarOpen)} onUpload={() => setUploadOpen(true)} />
}> {!immersive && (
© {new Date().getFullYear()} {locale.copyright}
)}
{sidebarOpen && (