- Added `lucide-react` dependency. - Updated `next` version to 15.3.1. - Added new icons: design-icon.png, home-icon.png, logo.png, menu-icon.png. - Added recent images: recent-image-1.png, recent-image-2.png, recent-image-3.png, recent-image-4.png, recent-image-5.png. - Updated devDependencies: added `@eslint/eslintrc`, `@tailwindcss/postcss`, and ensured `typescript` is included.
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import Image from "next/image";
|
|
import { usePathname } from "next/navigation";
|
|
|
|
// Navigation links configuration
|
|
const links = [
|
|
{
|
|
icon: "/home-icon.png",
|
|
label: "Home",
|
|
path: "/"
|
|
},
|
|
{
|
|
icon: "/design-icon.png",
|
|
label: "Design St.",
|
|
path: "/design"
|
|
}
|
|
];
|
|
|
|
/**
|
|
* Sidebar Component
|
|
* Displays a vertical navigation sidebar with icons and labels
|
|
* @returns JSX.Element
|
|
*/
|
|
export default function Sidebar() {
|
|
const pathname = usePathname();
|
|
|
|
return (
|
|
<div className="bg-[#050616] w-full md:w-[80px] h-auto md:h-screen">
|
|
<div className="flex md:flex-col items-center justify-between md:justify-start gap-4 p-4 md:pt-10">
|
|
{/* Menu Icon */}
|
|
<Image
|
|
src="/menu-icon.png"
|
|
alt="logo"
|
|
width={24}
|
|
height={24}
|
|
className="cursor-pointer"
|
|
/>
|
|
|
|
{/* Navigation Links */}
|
|
<div className="flex md:flex-col items-center md:items-start gap-4 md:gap-6 md:mt-10 w-full md:w-auto px-4">
|
|
{links.map((link) => (
|
|
<div key={link.path} className="flex flex-col items-center md:items-start w-auto">
|
|
{/* Link Icon Container */}
|
|
<div className={`p-2 rounded-lg ${pathname === link.path ? 'bg-[#1a1c2b]' : ''}`}>
|
|
<Image
|
|
src={link.icon}
|
|
alt={link.label}
|
|
width={24}
|
|
height={24}
|
|
className="cursor-pointer"
|
|
/>
|
|
</div>
|
|
|
|
{/* Link Label */}
|
|
<p className="text-white text-xs mt-1 hidden md:block">{link.label}</p>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
} |