-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnchorLang.tsx
More file actions
32 lines (32 loc) · 1.09 KB
/
AnchorLang.tsx
File metadata and controls
32 lines (32 loc) · 1.09 KB
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
interface AnchorLangProps {
lang: string;
languages: string[];
}
const AnchorLang = ({ lang: currentLang, languages }: AnchorLangProps) => {
return (
<ul className="fixed bottom-10 right-10 z-50 bg-slate-300/40 dark:bg-slate-700/40 backdrop-blur-sm rounded-lg px-1 py-1.5 group">
{languages.map((lang: string, index: number) => {
const isActive = lang === (currentLang ?? "es");
return (
<li key={index} className="mb-2">
<a
href={`/${lang}`}
className="flex flex-col justify-center items-center"
>
<span
className={`${
isActive
? "bg-white/70 dark:bg-black/70"
: "group-hover:bg-white/30 dark:group-hover:bg-black/30"
} text-black/60 dark:text-white/60 inline-flex text-xl px-2 py-1.5 font-bold rounded-md justify-center items-center aspect-video max-w-min`}
>
{lang}
</span>
</a>
</li>
);
})}
</ul>
);
};
export default AnchorLang;