import { Link, useFetcher } from "@remix-run/react";
import Meta from "~/lib/api/meta";
import { User, UserSettings } from "~/lib/api/user";
import Logo from "./Logo";
import { Nav, Navbar, NavDropdown } from "react-bootstrap";
import { BrightnessHigh, BrightnessHighFill, MoonFill } from "react-bootstrap-icons";
import { useTranslation } from "react-i18next";
export default function MainNavbar({
user,
settings,
}: {
meta: Meta;
user?: User;
settings: UserSettings;
}) {
const fetcher = useFetcher();
const { t } = useTranslation();
const userMenu = user ? (
@{user.username}>} align="end">
{t("navbar.view-profile")}
{t("navbar.settings")}
{t("navbar.log-out")}
) : (
{t("navbar.log-in")}
);
const ThemeIcon =
settings.dark_mode === null
? BrightnessHigh
: settings.dark_mode
? MoonFill
: BrightnessHighFill;
const theme = settings.dark_mode ? "dark" : "light";
return (
);
}