"use client"
import React from 'react'
import Link from 'next/link';
import { usePathname } from 'next/navigation';

const UserTab = ({isAdmin}) => {
    const path = usePathname();


  return (
    <div className='tabs flex gap-2 justify-center'>
        <Link href='/profile' className={path === '/profile' ? 'active' : ''}>Profile</Link>
        {isAdmin && (
          <>
            <Link href='/categories' className={path === '/categories' ? 'active' : ''}>Categories</Link>
            <Link href='/menu-items' className={path === '/menu-items' ? 'active' : ''}>Items</Link>
            <Link href='/users' className={path === '/users' ? 'active' : ''}>Users</Link>
          </>
        )}
    </div>
  )
}

export default UserTab