forked from phoenix/litellm-mirror
(fix) ui - clean up username
This commit is contained in:
parent
792999d756
commit
c7c10ca85e
1 changed files with 28 additions and 6 deletions
|
@ -3,6 +3,8 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
import type { MenuProps } from 'antd';
|
||||||
|
import { Dropdown, Space } from 'antd';
|
||||||
import { useSearchParams } from "next/navigation";
|
import { useSearchParams } from "next/navigation";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
|
@ -35,6 +37,18 @@ const Navbar: React.FC<NavbarProps> = ({
|
||||||
const isLocal = process.env.NODE_ENV === "development";
|
const isLocal = process.env.NODE_ENV === "development";
|
||||||
const imageUrl = isLocal ? "http://localhost:4000/get_image" : "/get_image";
|
const imageUrl = isLocal ? "http://localhost:4000/get_image" : "/get_image";
|
||||||
|
|
||||||
|
const items: MenuProps['items'] = [
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
label: (
|
||||||
|
<>
|
||||||
|
<p>Role: {userRole}</p>
|
||||||
|
<p>ID: {userID}</p>
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="left-0 right-0 top-0 flex justify-between items-center h-12 mb-4">
|
<nav className="left-0 right-0 top-0 flex justify-between items-center h-12 mb-4">
|
||||||
<div className="text-left my-2 absolute top-0 left-0">
|
<div className="text-left my-2 absolute top-0 left-0">
|
||||||
|
@ -62,12 +76,20 @@ const Navbar: React.FC<NavbarProps> = ({
|
||||||
</a>
|
</a>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<Button variant="secondary" size="lg">
|
<div style={{
|
||||||
{userEmail}
|
border: '1px solid #391085',
|
||||||
<p>Role: {userRole}</p>
|
padding: '6px',
|
||||||
<p>ID: {userID}</p>
|
borderRadius: '8px', // Added border-radius property
|
||||||
</Button>
|
}}
|
||||||
</div>
|
>
|
||||||
|
<Dropdown menu={{ items }} >
|
||||||
|
<Space>
|
||||||
|
{userEmail}
|
||||||
|
</Space>
|
||||||
|
</Dropdown>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue