website refactor
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Box } from '@/ui/Box';
|
||||
import { Icon } from '@/ui/Icon';
|
||||
import Link from 'next/link';
|
||||
import { Text } from '@/ui/Text';
|
||||
import Link from 'next/link';
|
||||
import { LucideIcon, ChevronRight } from 'lucide-react';
|
||||
|
||||
interface NavLinkProps {
|
||||
@@ -11,9 +11,10 @@ interface NavLinkProps {
|
||||
isActive?: boolean;
|
||||
variant?: 'sidebar' | 'top';
|
||||
collapsed?: boolean;
|
||||
LinkComponent?: React.ComponentType<{ href: string; children: React.ReactNode; className?: string }>;
|
||||
}
|
||||
|
||||
export function NavLink({ href, label, icon, isActive, variant = 'sidebar', collapsed = false }: NavLinkProps) {
|
||||
export function NavLink({ href, label, icon, isActive, variant = 'sidebar', collapsed = false, LinkComponent = Link as any }: NavLinkProps) {
|
||||
const isTop = variant === 'top';
|
||||
|
||||
// Radical "Game Menu" Style
|
||||
@@ -72,11 +73,11 @@ export function NavLink({ href, label, icon, isActive, variant = 'sidebar', coll
|
||||
);
|
||||
|
||||
return (
|
||||
<Link
|
||||
<LinkComponent
|
||||
href={href}
|
||||
className={`w-full group block ${!isTop ? '' : ''}`}
|
||||
>
|
||||
{content}
|
||||
</Link>
|
||||
</LinkComponent>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user