import classNames from "classnames"; import Link from "next/link"; import router from "next/router"; import React from "react"; import { useEffect, useState } from "react"; import Typography, { ITypo } from "../../Typography"; import classes from "./classes.module.scss"; type IPropsClass = { text: string | JSX.Element; path?: string; isActive?: boolean; }; type IStateClass = {}; class HeaderLinkClass extends React.Component { public override render(): JSX.Element { if (this.props.path !== "" && this.props.path !== undefined) { return (
{this.props.text}
{this.props.isActive &&
} ); } else { return (
{this.props.text}
); } } } export default function HeaderLink(props: IPropsClass) { const [url, setUrl] = useState(""); useEffect(() => setUrl(router?.asPath), []); const isActive = url.includes(props.path!); return ; }