'use client';
import React, { useEffect, useState } from 'react';
import { Button } from '@nextui-org/react';
import Image from 'next/image';
import {
IoFlask,
IoHome,
IoInformationCircle,
IoLink,
IoLogoGithub,
IoMail,
IoPencil,
IoSearch
} from 'react-icons/io5';
import Link from 'next/link';
import ThemeSwitcher from '@/components/ThemeSwitcher';
import { usePathname } from 'next/navigation';
import { useScreenSizeTrigger } from '@/app/public/screenSizeTrigger';
const entries: { display_name: string; href: string; icon: React.ReactNode }[] = [
{
icon: ,
display_name: 'Home',
href: '/'
},
{
icon: ,
display_name: 'About',
href: '/about'
},
{
icon: ,
display_name: 'Blog',
href: '/blog'
},
{
icon: ,
display_name: 'Friends',
href: '/friends'
},
{
icon: ,
display_name: 'Search',
href: '/search'
}, {
icon: ,
display_name: 'Lab',
href: 'https://lab.lmt.moe'
}
];
const connections: { label: string, href: string, icon: React.ReactNode }[] = [
{
label: 'Github',
href: 'https://github.com/Lumither',
icon:
},
{
label: 'email',
href: 'mailto:lumither@outlook.com',
icon:
}
];
function Navbar() {
const path = usePathname();
const [ shownPath, setShownPath ] = useState(path);
useEffect(() => {
let trimmed_path = path.split(`/`)[1];
if (trimmed_path === '') {
setShownPath('HOME');
} else {
setShownPath(trimmed_path.toUpperCase());
}
}, [ path ]);
const isMobile = useScreenSizeTrigger('lg');
return (
<>
{
connections.map((conn, key) => (
-
))
}
{
entries.map((meta, key) => (
-
))
}
>
);
}
export default Navbar;