import { SyntheticEvent, useState } from "react"; import { useHistory, useLocation } from "react-router-dom"; import { NavLink, Link } from "react-router-dom"; import { BoxArrowRight, Search } from "react-bootstrap-icons"; import { useAuth } from "../useAuth"; import { Dropdown, Navbar } from "react-bootstrap"; import { ProfilePicture } from "../util"; export default function Nav() { const auth = useAuth(); const history = useHistory(); const location = useLocation(); const logout = async (e: SyntheticEvent) => { e.preventDefault(); await auth?.logout(); }; const [search, setSearch] = useState( location.pathname === "/search" ? new URLSearchParams(location.search).get("q") || "" : "" ); const submitSearchForm = (e: SyntheticEvent) => { e.preventDefault(); if (search != "") { history.push(`/search?q=${encodeURIComponent(search)}`); } }; return (
✈️ chartered
  • Home
  • SSH Keys
  • { return ( location.pathname.startsWith("/organisations/") || location.pathname.startsWith("/crates/") ); }} > Organisations
setSearch(e.target.value)} />
  • Your profile Logout
); }