forked from admin/zeropost-tool
1fbdc9f9b9
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
19 lines
551 B
JavaScript
19 lines
551 B
JavaScript
'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>
|
|
);
|
|
}
|