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-04-02 02:43:36 -03:00
|
|
|
<div className="space-y-1 px-2">
|
2025-03-30 19:28:28 -03:00
|
|
|
{links.map((link, index) => (
|
|
|
|
<button
|
|
|
|
key={index}
|
2025-04-02 02:43:36 -03:00
|
|
|
className={`w-full flex items-center py-2 px-2 rounded-md text-sm ${
|
|
|
|
link.variant === 'default' ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-100'
|
|
|
|
} ${isCollapsed ? 'justify-center' : 'justify-between'}`}
|
2025-03-30 19:28:28 -03:00
|
|
|
>
|
2025-04-02 02:43:36 -03:00
|
|
|
<div className="flex items-center gap-3">
|
2025-03-30 19:28:28 -03:00
|
|
|
<span className="w-5 h-5 flex items-center justify-center">
|
|
|
|
{link.icon}
|
|
|
|
</span>
|
2025-03-30 16:42:51 -03:00
|
|
|
{!isCollapsed && (
|
2025-04-02 02:43:36 -03:00
|
|
|
<span>{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
|
|
|
);
|
|
|
|
}
|