import { chakra, PropsOf, useColorModeValue } from "@chakra-ui/react" import NextLink from "next/link" import { useRouter } from "next/router" import React from "react" const StyledLink = React.forwardRef(function StyledLink( props: PropsOf & { isActive?: boolean }, ref: React.Ref, ) { const { isActive, icon,children, ...rest } = props return ( {icon} {children} ) }) type SidebarLinkProps = PropsOf & { href?: string icon?: React.ReactElement } const SidebarLink = (props: SidebarLinkProps) => { const { href, icon, children, ...rest } = props const { asPath } = useRouter() const isActive = asPath.indexOf(href) > -1 return ( {children} ) } export default SidebarLink