show credential pw

This commit is contained in:
ff
2026-04-07 23:52:05 -04:00
parent cb97e249d0
commit b9edd6a5e6
16 changed files with 1846 additions and 318 deletions

View File

@@ -16,10 +16,13 @@ import {
import { cn } from "@/lib/utils";
import { useMemo } from "react";
import { useSidebar } from "@/components/ui/sidebar";
import { useAuth } from "@/hooks/use-auth";
export function Sidebar() {
const [location] = useLocation();
const { state, openMobile, setOpenMobile } = useSidebar(); // "expanded" | "collapsed"
const { user } = useAuth();
const isAdmin = user?.username === "admin";
const navItems = useMemo(
() => [
@@ -82,6 +85,7 @@ export function Sidebar() {
name: "Settings",
path: "/settings",
icon: <Settings className="h-5 w-5" />,
adminOnly: true,
},
],
[]
@@ -107,7 +111,7 @@ export function Sidebar() {
>
<div className="p-2">
<nav role="navigation" aria-label="Main">
{navItems.map((item) => (
{navItems.filter((item) => !item.adminOnly || isAdmin).map((item) => (
<div key={item.path}>
<Link to={item.path} onClick={() => setOpenMobile(false)}>
<div