Extract Navbar, MobileNav, and UserMenu from AuthenticatedLayout.tsx. Extract SessionTable, SessionDeck, and SessionsScript from SessionsPage.tsx. Preserves existing pure Hono SSR JSX and logic. Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
export const UserMenu = ({ isAdmin = false }: { isAdmin?: boolean }) => {
|
|
return (
|
|
<div class="header-actions">
|
|
{isAdmin && (
|
|
<a
|
|
href="/admin/users"
|
|
class="btn-primary"
|
|
style="padding: 0.4rem 0.85rem; font-size: 0.85rem; min-height: 36px; height: 36px; box-sizing: border-box; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;"
|
|
>
|
|
<svg
|
|
width="15"
|
|
height="15"
|
|
viewBox="0 0 24 24"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
stroke-width="2"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
>
|
|
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z">
|
|
</path>
|
|
</svg>
|
|
<span>Admin Console</span>
|
|
</a>
|
|
)}
|
|
<a
|
|
href="/logout"
|
|
class="logout-link"
|
|
title="Sign out of your session"
|
|
>
|
|
<svg
|
|
width="16"
|
|
height="16"
|
|
viewBox="0 0 24 24"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
stroke-width="2"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
>
|
|
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
|
|
<polyline points="16 17 21 12 16 7"></polyline>
|
|
<line x1="21" x2="9" y1="12" y2="12"></line>
|
|
</svg>
|
|
<span>Logout</span>
|
|
</a>
|
|
</div>
|
|
);
|
|
};
|