"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-1 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.includes('menu-items')  ? 'active' : ''}>Items</Link>
            <Link href='/users' className={path.includes('users') ? 'active' : ''}>Users</Link>
          </>
        )}
        <Link href='/orders' className={path === '/orders' ? 'active' : ''}>Orders</Link>
    </div>
  )
}

export default UserTab