'use client';
import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import Link from 'next/link';
import AdminLogo from '../../components/AdminLogo';
export default function AdminDashboard() {
const [isAuthenticated, setIsAuthenticated] = useState(false);
const router = useRouter();
useEffect(() => {
// Check if admin is logged in
const adminLoggedIn = sessionStorage.getItem('adminLoggedIn');
if (adminLoggedIn !== 'true') {
router.push('/admin');
return;
}
setIsAuthenticated(true);
}, [router]);
const handleLogout = () => {
sessionStorage.removeItem('adminLoggedIn');
router.push('/admin');
};
if (!isAuthenticated) {
return null;
}
const adminActions = [
{
id: 'add-job',
title: 'Add New Job',
description: 'Create a new service job for a vehicle',
href: '/admin/jobs/add',
},
{
id: 'view-jobs',
title: 'View All Jobs',
description: 'Browse and search all service jobs',
href: '/admin/jobs',
},
// Add more actions here in the future
];
return (
<>
{action.description}
))}