add referrals levels

This commit is contained in:
smanylov
2026-02-09 13:11:25 +07:00
parent e36d67be17
commit e8b9b5e1b9
6 changed files with 115 additions and 87 deletions
+11 -6
View File
@@ -5,7 +5,9 @@ import { usePathname } from 'next/navigation';
import { useTranslations } from 'next-intl';
import { useSideMenuStore } from '@/app/stores/sideMenuStore';
export default function DropDownList() {
export default function DropDownList(
{ referralLink }: { referralLink: string | null }
) {
const pathname = usePathname().replace('/en/', '/').replace('/ru/', '/');
const [dropDownExpanded, setDropDownExpanded] = useState(false);
const t = useTranslations('Global');
@@ -17,19 +19,19 @@ export default function DropDownList() {
const links = [
{
name: t('photo-marking'),
name: 'photo-marking',
href: '/pages/marking-images'
},
{
name: t('video-marking'),
name: 'video-marking',
href: '/pages/marking-video'
},
{
name: t('audio-marking'),
name: 'audio-marking',
href: '/pages/marking-audio'
},
{
name: t('document-marking'),
name: 'document-marking',
href: '/pages/marking-document'
}
];
@@ -54,6 +56,9 @@ export default function DropDownList() {
</div>
<ul className={`sub-menu ${dropDownExpanded ? 'expanded' : ''}`}>
{links.map((link) => {
if (referralLink && link.name === 'document-marking') {
return null;
}
return (
<Link
key={link.name}
@@ -68,7 +73,7 @@ export default function DropDownList() {
setMenuState(false)
}}
>
<p className="">{link.name}</p>
<p className="">{t(link.name)}</p>
</Link>
);
})}