2025-04-02 17:47:30 -05:00
|
|
|
import React from 'react';
|
2024-03-13 17:45:55 -05:00
|
|
|
import { TabMenu } from 'primereact/tabmenu';
|
2025-04-13 12:43:24 -05:00
|
|
|
import { Button } from 'primereact/button';
|
2025-04-13 14:36:55 -05:00
|
|
|
import GenericButton from '@/components/buttons/GenericButton';
|
2024-03-13 17:45:55 -05:00
|
|
|
|
2025-04-13 12:43:24 -05:00
|
|
|
export default function MenuTab({ items, activeIndex, onTabChange, sidebarVisible, onToggleSidebar, isMobileView = false }) {
|
2025-04-02 17:47:30 -05:00
|
|
|
return (
|
2025-04-13 12:43:24 -05:00
|
|
|
<div className="w-[100%] relative">
|
2025-04-02 17:47:30 -05:00
|
|
|
<TabMenu
|
|
|
|
className="w-full bg-transparent border-none"
|
|
|
|
model={items}
|
|
|
|
activeIndex={activeIndex}
|
|
|
|
onTabChange={e => onTabChange(e.index)}
|
|
|
|
pt={{
|
|
|
|
tabmenu: {
|
|
|
|
menu: ({ context }) => ({
|
|
|
|
className: 'bg-transparent border-none',
|
|
|
|
}),
|
|
|
|
action: ({ context }) => ({
|
|
|
|
className: 'bg-transparent border-none',
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
2025-04-13 12:43:24 -05:00
|
|
|
|
|
|
|
{/* Sidebar toggle button positioned at the far right - hidden on mobile */}
|
|
|
|
{!isMobileView && (
|
|
|
|
<div className="absolute right-2 top-0 flex items-center h-full">
|
2025-04-13 14:36:55 -05:00
|
|
|
<GenericButton
|
2025-04-13 12:43:24 -05:00
|
|
|
icon={sidebarVisible
|
|
|
|
? "pi pi-times"
|
|
|
|
: "pi pi-chevron-left"}
|
|
|
|
onClick={onToggleSidebar}
|
2025-04-13 14:36:55 -05:00
|
|
|
outlined={true}
|
2025-04-13 12:43:24 -05:00
|
|
|
style={{
|
|
|
|
width: '2.5rem',
|
|
|
|
height: '2.5rem',
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
border: 'none',
|
|
|
|
fontWeight: 'bold'
|
|
|
|
}}
|
|
|
|
tooltip={sidebarVisible ? "Hide lessons" : "Show lessons"}
|
|
|
|
tooltipOptions={{ position: 'bottom' }}
|
|
|
|
aria-label="Toggle course lessons"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)}
|
2025-04-02 17:47:30 -05:00
|
|
|
</div>
|
|
|
|
);
|
2024-03-13 17:45:55 -05:00
|
|
|
}
|