more user role stuff

This commit is contained in:
Milo Schwartz 2024-11-09 23:59:19 -05:00
parent bb17d30c9e
commit 231e1d2e2d
No known key found for this signature in database
32 changed files with 897 additions and 138 deletions

View file

@ -32,6 +32,7 @@ export function SidebarNav({
const orgId = params.orgId as string;
const niceId = params.niceId as string;
const resourceId = params.resourceId as string;
const userId = params.userId as string;
const router = useRouter();
@ -50,7 +51,8 @@ export function SidebarNav({
return val
.replace("{orgId}", orgId)
.replace("{niceId}", niceId)
.replace("{resourceId}", resourceId);
.replace("{resourceId}", resourceId)
.replace("{userId}", userId);
}
return (
@ -86,21 +88,11 @@ export function SidebarNav({
>
{items.map((item) => (
<Link
key={item.href
.replace("{orgId}", orgId)
.replace("{niceId}", niceId)
.replace("{resourceId}", resourceId)}
href={item.href
.replace("{orgId}", orgId)
.replace("{niceId}", niceId)
.replace("{resourceId}", resourceId)}
key={hydrateHref(item.href)}
href={hydrateHref(item.href)}
className={cn(
buttonVariants({ variant: "ghost" }),
pathname ===
item.href
.replace("{orgId}", orgId)
.replace("{niceId}", niceId)
.replace("{resourceId}", resourceId) &&
pathname === hydrateHref(item.href) &&
!pathname.includes("create")
? "bg-muted hover:bg-muted dark:bg-border dark:hover:bg-border"
: "hover:bg-transparent hover:underline",