Update src/app/movements/page.tsx
This commit is contained in:
@@ -1,44 +1,32 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import ReactLenis from "lenis/react";
|
||||
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import AuthGuard from "../AuthGuard";
|
||||
import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
|
||||
export default function MovementsPage() {
|
||||
const navItems = [
|
||||
{ name: "Özellikler", id: "features" },
|
||||
{ name: "Fiyatlandırma", id: "pricing" },
|
||||
{ name: "İzlenebilirlik", id: "traceability" },
|
||||
{ name: "Günlükler", id: "/logs" },
|
||||
{ name: "Hareketler", id: "/movements" },
|
||||
{ name: "Raporlar", id: "/reports" },
|
||||
{ name: "Hakkımızda", id: "about" },
|
||||
{ name: "Varyasyonlar", id: "/product-variations" },
|
||||
{ name: "Üretim", id: "/production" },
|
||||
{ name: "Reçeteler", id: "/recipes" },
|
||||
{ name: "Yönetim Paneli", id: "/superadmin" },
|
||||
{ name: "Giriş Yap", id: "/login" },
|
||||
{ name: "Gösterge Paneli", id: "/dashboard" },
|
||||
{ name: "İletişim", id: "contact" }
|
||||
];
|
||||
const { isAuthenticated, isLoading } = useAuth();
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<ThemeProvider defaultButtonVariant="hover-bubble" defaultTextAnimation="entrance-slide" borderRadius="pill" contentWidth="medium" sizing="medium" background="none" cardStyle="gradient-bordered" primaryButtonStyle="primary-glow" secondaryButtonStyle="layered" headingFontWeight="medium">
|
||||
<AuthGuard>
|
||||
<ReactLenis root>
|
||||
<NavbarLayoutFloatingInline
|
||||
navItems={navItems}
|
||||
brandName="Stokify"
|
||||
button={{ text: "Hemen Başla", href: "#contact" }}
|
||||
/>
|
||||
<main className="container mx-auto px-4 py-16 min-h-[calc(100vh-100px)] flex flex-col items-center justify-center text-center">
|
||||
<h1 className="text-4xl font-bold mb-4">Stok Hareketleri</h1>
|
||||
<p className="text-lg text-gray-600">Ürünlerin giriş ve çıkış hareketleri bu sayfada görüntülenecektir.</p>
|
||||
</main>
|
||||
</ReactLenis>
|
||||
</AuthGuard>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
useEffect(() => {
|
||||
if (!isLoading && !isAuthenticated) {
|
||||
router.push('/login');
|
||||
}
|
||||
}, [isAuthenticated, isLoading, router]);
|
||||
|
||||
if (isLoading) {
|
||||
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
|
||||
}
|
||||
|
||||
if (!isAuthenticated) {
|
||||
return null; // Or a loading spinner, as the redirect will happen soon
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
|
||||
<h1 className="text-5xl font-extrabold mb-4">Hareketler Paneli</h1>
|
||||
<p className="text-xl text-center mb-8">Ürünlerin tüm hareket geçmişini buradan takip edebilirsiniz.</p>
|
||||
<p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user