Following are the fundamental building blocks to creating a route.
import React, { Fragment } from "react";
import Link from 'next/link';
import { useRouter } from "next/router";
<ul>
<li>
<Link href="/">Home
</Link>
</li>
<li>
<Link href="/about">About Us
</Link>
</li>
<li>
<Link href="/blog/hello-world">Blog Post
</Link>
</li>
</ul>
Following are the fundamental building blocks to creating a new link.
├── shared
├──layouts-components
├──sidebar
├──sidemenu.tsx
export interface Menuitemtype {
menutitle?: string;
path?: string;
title?: string;
icon?: any;
type?: 'link' | 'empty' | 'sub';
active?: boolean;
selected?: boolean;
dirchange?: boolean;
children?: Menuitemtype[];
badgetxt?: string;
class?: string;
menusub?: boolean;
}
// icons
const dashboardsvg = <svg xmlns="http://www.w3.org/2000/svg" className="side-menu__icon" viewBox="0 0 24 24" >
<path d="M0 0h24v24H0V0z" fill="none" /> <path d="M5 5h4v6H5zm10 8h4v6h-4zM5 17h4v2H5zM15 5h4v2h-4z" opacity=".3" />
<path d="M3 13h8V3H3v10zm2-8h4v6H5V5zm8 16h8V11h-8v10zm2-8h4v6h-4v-6zM13 3v6h8V3h-8zm6 4h-4V5h4v2zM3 21h8v-6H3v6zm2-4h4v2H5v-2z" /></svg>
export const MENUITEMS: Menuitemtype[] = [
{ menutitle: "MAIN" },
{ path: "/components/dashboard/dashboard", icon: dashboardsvg, badgetxt:"1", class:"badge bg-success ms-auto menu-badge", type: "link", active: false, selected: false, dirchange: false, title: "Index" },
{ menutitle: "GENERAL" },
{ path: "/components/icons/icon", icon: iconsvg, type: "link", active: false, selected: false, dirchange: false, title: "Icons" },
]