2025-03-30 16:42:51 -03:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
interface NavProps {
|
|
|
|
isCollapsed: boolean;
|
|
|
|
links: {
|
|
|
|
title: string;
|
|
|
|
label?: string;
|
2025-03-30 19:28:28 -03:00
|
|
|
icon: React.ReactNode;
|
2025-03-30 16:42:51 -03:00
|
|
|
variant: 'default' | 'ghost';
|
|
|
|
}[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export function Nav({ links, isCollapsed }: NavProps) {
|
|
|
|
return (
|
2025-03-30 19:28:28 -03:00
|
|
|
<div className={`flex ${isCollapsed ? 'flex-col items-center' : 'flex-col'}`}>
|
|
|
|
{links.map((link, index) => (
|
|
|
|
<button
|
|
|
|
key={index}
|
|
|
|
className={`flex items-center p-2 rounded ${link.variant === 'default' ? 'bg-gray-100' : ''} ${isCollapsed ? 'justify-center' : 'justify-between'}`}
|
|
|
|
>
|
|
|
|
<div className="flex items-center">
|
|
|
|
<span className="w-5 h-5 flex items-center justify-center">
|
|
|
|
{link.icon}
|
|
|
|
</span>
|
2025-03-30 16:42:51 -03:00
|
|
|
{!isCollapsed && (
|
2025-03-30 19:28:28 -03:00
|
|
|
<span className="ml-2">{link.title}</span>
|
2025-03-30 16:42:51 -03:00
|
|
|
)}
|
2025-03-30 19:28:28 -03:00
|
|
|
</div>
|
|
|
|
{!isCollapsed && link.label && (
|
|
|
|
<span className="text-xs text-gray-500">{link.label}</span>
|
|
|
|
)}
|
|
|
|
</button>
|
|
|
|
))}
|
|
|
|
</div>
|
2025-03-30 16:42:51 -03:00
|
|
|
);
|
|
|
|
}
|