'use client';
import { forwardRef, HTMLAttributes } from 'react';
export interface CornerNavProps extends HTMLAttributes {
/** Corner position */
corner?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
/** Navigation items */
items: Array<{
id: string;
label: string;
href?: string;
onClick?: () => void;
icon?: string;
active?: boolean;
}>;
/** Nav style */
style?: 'ornate' | 'minimal' | 'brutal' | 'neon';
/** Orientation of items */
orientation?: 'horizontal' | 'vertical' | 'diagonal';
/** Show corner decorations */
decorations?: boolean;
}
const cornerClasses: Record = {
'top-left': 'top-6 left-6',
'top-right': 'top-6 right-6',
'bottom-left': 'bottom-6 left-6',
'bottom-right': 'bottom-6 right-6',
};
const orientationClasses: Record = {
horizontal: 'flex-row',
vertical: 'flex-col',
diagonal: 'flex-col',
};
const styleClasses: Record = {
ornate: {
nav: '',
item: 'rounded-sm',
activeItem: 'font-bold',
},
minimal: {
nav: '',
item: 'rounded-sm',
activeItem: 'font-bold',
},
brutal: {
nav: '',
item: 'bg-black text-white border-2 border-rose-500 px-4 py-2',
activeItem: 'font-bold',
},
neon: {
nav: '',
item: 'text-cyan-400 text-cyan-400 border border-cyan-400 bg-cyan-400/10 shadow-[0_0_10px_#00ffff]',
activeItem: 'font-bold',
},
};
export const CornerNav = forwardRef(
(
{
corner = 'top-left',
items,
style: navStyle = 'ornate',
orientation = 'horizontal',
decorations = true,
className,
...props
},
ref
) => {
const styleConfig = styleClasses[navStyle];
return (
);
}
);
CornerNav.displayName = 'CornerNav';
export default CornerNav;