feat(navigation): add qualification course link
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
d04b2d3ecb
commit
8e9262ca68
1 changed files with 7 additions and 5 deletions
|
|
@ -5,6 +5,7 @@ import {
|
|||
Bird,
|
||||
Bomb,
|
||||
ChevronsUpDown,
|
||||
Crosshair,
|
||||
FileTextIcon,
|
||||
LogOut,
|
||||
Radio,
|
||||
|
|
@ -30,7 +31,6 @@ import {
|
|||
SidebarMenuItem,
|
||||
useSidebar,
|
||||
} from "@/components/ui/sidebar";
|
||||
import type { User } from "@/payload-types";
|
||||
import { ImpersonationModal } from "@/components/frontend/impersonation/ImpersonationModal";
|
||||
import { getImpersonationUsers } from "@/app/(frontend)/impersonate/actions";
|
||||
|
||||
|
|
@ -52,7 +52,6 @@ export function NavUser({
|
|||
const [loggingOut, setLoggingOut] = useState(false);
|
||||
const [showImpersonationModal, setShowImpersonationModal] = useState(false);
|
||||
const [impersonationUsers, setImpersonationUsers] = useState<any[]>([]);
|
||||
const [loadingImpersonationUsers, setLoadingImpersonationUsers] = useState(false);
|
||||
|
||||
const primaryLine = showCallsign ? user.username : user.displayName;
|
||||
const secondaryLine = showCallsign ? user.displayName : user.username;
|
||||
|
|
@ -71,14 +70,11 @@ export function NavUser({
|
|||
};
|
||||
|
||||
const handleOpenImpersonationModal = async () => {
|
||||
setLoadingImpersonationUsers(true);
|
||||
try {
|
||||
const users = await getImpersonationUsers();
|
||||
setImpersonationUsers(users);
|
||||
} catch (error) {
|
||||
console.error("Failed to load impersonation users:", error);
|
||||
} finally {
|
||||
setLoadingImpersonationUsers(false);
|
||||
}
|
||||
setShowImpersonationModal(true);
|
||||
};
|
||||
|
|
@ -154,6 +150,12 @@ export function NavUser({
|
|||
Radio Traffic
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem asChild>
|
||||
<Link href="/qualification">
|
||||
<Crosshair />
|
||||
Qualification Course
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue