Skip to content
Snippets Groups Projects
Commit 78b0a910 authored by timothycarambat's avatar timothycarambat
Browse files

Hide member tab on workspace settings when not in multi-user mode

parent 41fe20f2
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ import GeneralAppearance from "./GeneralAppearance";
import ChatSettings from "./ChatSettings";
import VectorDatabase from "./VectorDatabase";
import Members from "./Members";
import useUser from "@/hooks/useUser";
const TABS = {
"general-appearance": GeneralAppearance,
......@@ -40,6 +41,7 @@ export default function WorkspaceSettings() {
function ShowWorkspaceChat() {
const { slug, tab } = useParams();
const { user } = useUser();
const [workspace, setWorkspace] = useState(null);
const [loading, setLoading] = useState(true);
......@@ -98,6 +100,7 @@ function ShowWorkspaceChat() {
title="Members"
icon={<User className="h-6 w-6" />}
to={paths.workspace.settings.members(slug)}
visible={["admin", "manager"].includes(user?.role)}
/>
</div>
<div className="px-16 py-6">
......@@ -108,7 +111,8 @@ function ShowWorkspaceChat() {
);
}
function TabItem({ title, icon, to }) {
function TabItem({ title, icon, to, visible = true }) {
if (!visible) return null;
return (
<NavLink
to={to}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment