diff --git a/src/app/movements/page.tsx b/src/app/movements/page.tsx index b34c92a..6a3a4f8 100644 --- a/src/app/movements/page.tsx +++ b/src/app/movements/page.tsx @@ -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 ( - - - - -
-

Stok Hareketleri

-

Ürünlerin giriş ve çıkış hareketleri bu sayfada görüntülenecektir.

-
-
-
-
- ); -} \ No newline at end of file + useEffect(() => { + if (!isLoading && !isAuthenticated) { + router.push('/login'); + } + }, [isAuthenticated, isLoading, router]); + + if (isLoading) { + return
Yükleniyor...
; + } + + if (!isAuthenticated) { + return null; // Or a loading spinner, as the redirect will happen soon + } + + return ( +
+

Hareketler Paneli

+

Ürünlerin tüm hareket geçmişini buradan takip edebilirsiniz.

+

Yalnızca yetkili kullanıcılar erişebilir.

+
+ ); +}