---
import Icon from './Icon.astro';
import ThemeToggle from './ThemeToggle.astro';
import type { iconPaths } from './IconPaths';
/** Main menu items */
const textLinks: { label: string; href: string }[] = [
{ label: 'Home', href: '/' },
{ label: 'Work', href: '/work/' },
{ label: 'About', href: '/about/' },
];
/** Icon links to social media — edit these with links to your profiles! */
const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[] = [
{ label: 'Twitter', href: 'https://twitter.com/me', icon: 'twitter-logo' },
{ label: 'Twitch', href: 'https://twitch.tv/me', icon: 'twitch-logo' },
{ label: 'GitHub', href: 'https://github.com/me', icon: 'github-logo' },
{ label: 'CodePen', href: 'https://codepen.io/me', icon: 'codepen-logo' },
{ label: 'dribbble', href: 'https://dribbble.com/me', icon: 'dribbble-logo' },
{ label: 'YouTube', href: 'https://www.youtube.com/@me/', icon: 'youtube-logo' },
];
/** Test if a link is pointing to the current page. */
const isCurrentPage = (href: string) => {
let pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, '');
if (pathname.at(0) !== '/') pathname = '/' + pathname;
if (pathname.at(-1) !== '/') pathname += '/';
return pathname === href || (href !== '/' && pathname.startsWith(href));
};
---