import { Dialog, Transition } from '@headlessui/react';
import { XMarkIcon } from '@heroicons/react/24/outline';
import React, { Fragment } from 'react';
import { MENU_CODE } from '../constant';
import NavMobileContent from './nav-mobile-content';
export default function NavMobile({ hiddenSideBar, menu, path, pathNameWithBasePath, permission, router, setSidebarOpen, sidebarOpen, }) {
    return (React.createElement(Transition.Root, { as: Fragment, show: sidebarOpen },
        React.createElement(Dialog, { as: 'div', className: 'relative z-40 lg:hidden', onClose: setSidebarOpen },
            React.createElement(Transition.Child, { as: Fragment, enter: 'transition-opacity ease-linear duration-300', enterFrom: 'opacity-0', enterTo: 'opacity-100', leave: 'transition-opacity ease-linear duration-300', leaveFrom: 'opacity-100', leaveTo: 'opacity-0' },
                React.createElement("div", { className: 'fixed inset-0 bg-gray-600 bg-opacity-75' })),
            React.createElement("div", { className: 'fixed inset-0 z-40 flex' },
                React.createElement(Transition.Child, { as: Fragment, enter: 'transition ease-in-out duration-300 transform', enterFrom: '-translate-x-full', enterTo: 'translate-x-0', leave: 'transition ease-in-out duration-300 transform', leaveFrom: 'translate-x-0', leaveTo: '-translate-x-full' },
                    React.createElement(Dialog.Panel, { className: 'relative flex w-full max-w-xs flex-1 flex-col bg-gray-200' },
                        React.createElement(Transition.Child, { as: Fragment, enter: 'ease-in-out duration-300', enterFrom: 'opacity-0', enterTo: 'opacity-100', leave: 'ease-in-out duration-300', leaveFrom: 'opacity-100', leaveTo: 'opacity-0' },
                            React.createElement("div", { className: 'absolute right-0 top-0 -mr-12 pt-2' },
                                React.createElement("button", { className: 'ml-1 flex h-10 w-10 items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white', onClick: () => setSidebarOpen(false), type: 'button' },
                                    React.createElement("span", { className: 'sr-only' }, "Close sidebar"),
                                    React.createElement(XMarkIcon, { "aria-hidden": 'true', className: 'h-6 w-6 text-white' })))),
                        React.createElement("div", { className: 'mt-8 h-0 flex-1 overflow-y-auto pb-4 pt-5' },
                            React.createElement("nav", { className: 'space-y-1 px-2' },
                                React.createElement(NavMobileContent, { hiddenSideBar: hiddenSideBar, 
                                    // menu setting sẽ được để sang 1 section riêng
                                    menu: menu.filter((item) => item.code !== MENU_CODE.SETTING_SITE), pathName: path, pathNameWithBasePath: pathNameWithBasePath, permission: permission, router: router }))))),
                React.createElement("div", { "aria-hidden": 'true', className: 'w-14 flex-shrink-0' })))));
}
//# sourceMappingURL=nav-mobile.js.map