-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathindex.tsx
More file actions
65 lines (54 loc) · 1.87 KB
/
index.tsx
File metadata and controls
65 lines (54 loc) · 1.87 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { useTranslations } from 'next-intl';
import type { FC, SVGProps } from 'react';
import NavItem from '@/components/Containers/NavBar/NavItem';
import Bluesky from '@/components/Icons/Social/Bluesky';
import GitHub from '@/components/Icons/Social/GitHub';
import LinkedIn from '@/components/Icons/Social/LinkedIn';
import Mastodon from '@/components/Icons/Social/Mastodon';
import Slack from '@/components/Icons/Social/Slack';
import Twitter from '@/components/Icons/Social/Twitter';
import type { FooterConfig, SocialConfig } from '@/types';
import styles from './index.module.css';
const footerSocialIcons: Record<string, React.FC<SVGProps<SVGSVGElement>>> = {
github: GitHub,
mastodon: Mastodon,
twitter: Twitter,
slack: Slack,
linkedin: LinkedIn,
bluesky: Bluesky,
};
type FooterProps = {
socialLinks: Array<SocialConfig>;
footerLinks: Array<FooterConfig>;
};
const Footer: FC<FooterProps> = ({ socialLinks, footerLinks }) => {
const t = useTranslations();
const openJSlink = footerLinks.at(-1)!;
return (
<footer className={styles.footer}>
<div className={styles.sectionPrimary}>
{footerLinks.slice(0, -1).map(item => (
<NavItem type="footer" href={item.link} key={item.link}>
{t(item.text)}
</NavItem>
))}
</div>
<div className={styles.sectionSecondary}>
<NavItem type="footer" href={openJSlink.link}>
© {openJSlink.text}
</NavItem>
<div className={styles.social}>
{socialLinks.map(link => {
const SocialIcon = footerSocialIcons[link.icon];
return (
<NavItem key={link.icon} href={link.link} type="footer">
<SocialIcon width={20} height={20} aria-label={link.link} />
</NavItem>
);
})}
</div>
</div>
</footer>
);
};
export default Footer;