Spaces:
Running
Running
File size: 1,172 Bytes
9cd6ddb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
import classNames from "classnames";
import LinkComp from "next/link";
import { useRouter } from "next/router";
import { FormattedMessage } from "react-intl";
export const Link = ({
name,
link,
comingSoon,
}: {
name: string;
link: string;
comingSoon?: boolean;
}) => {
const { pathname } = useRouter();
return comingSoon ? (
<li className="flex items-center justify-start gap-3 text-white text-center text-opacity-80 font-medium text-sm tracking-wide cursor-not-allowed">
<span className="text-opacity-50">
<FormattedMessage id={name} />
</span>
<span className="text-xs bg-yellow bg-opacity-90 text-white rounded-full px-2 py-1 text-opacity-100 text-center">
<FormattedMessage id="badge.comingSoon" />
</span>
</li>
) : (
<LinkComp key={name} href={link}>
<li
className={classNames(
"flex items-center text-center justify-start gap-3 text-white opacity-80 hover:opacity-100 font-medium text-sm tracking-wide",
{
"!opacity-100": pathname === link,
}
)}
>
<FormattedMessage id={name} />
</li>
</LinkComp>
);
};
|