forked from admin/zeropost-tool
feat: unified admin panel + back buttons everywhere
AdminPanel.js: sidebar nav с 4 разделами (Настройки API, ЮKassa, Расходы AI, Пользователи) Встроены: SettingsSection (API-ключи), SpendingSection (расходы), AdminBilling Breadcrumb навигация /system/page.js: теперь рендерит AdminPanel Header: 'Расходы' → 'Админ' (ссылка на /system), убран TrendingUp BackButton.js: переиспользуемая кнопка назад Добавлена на /drafts, /billing, /plans
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
'use client';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
|
||||
export default function BackButton({ href, label = 'Назад' }) {
|
||||
const router = useRouter();
|
||||
function go() {
|
||||
if (href) router.push(href);
|
||||
else if (window.history.length > 1) router.back();
|
||||
else router.push('/');
|
||||
}
|
||||
return (
|
||||
<button onClick={go} className="btn-ghost flex items-center gap-1.5 text-sm text-gray-400 hover:text-gray-200 mb-4 -ml-1">
|
||||
<ArrowLeft className="w-4 h-4" />
|
||||
{label}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user