mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Updates to team components.
This commit is contained in:
parent
102f5b78b1
commit
dbb3801e66
28 changed files with 173 additions and 159 deletions
|
|
@ -1,18 +0,0 @@
|
|||
'use client';
|
||||
import { usePathname } from 'next/navigation';
|
||||
|
||||
export function useTeamContext(): {
|
||||
teamId?: string;
|
||||
renderTeamUrl: (url: string) => string;
|
||||
} {
|
||||
const pathname = usePathname();
|
||||
const [, teamId] = pathname.match(/^\/teams\/([a-f0-9-]+)/) || [];
|
||||
|
||||
function renderTeamUrl(url: string) {
|
||||
return teamId ? `/teams/${teamId}${url}` : url;
|
||||
}
|
||||
|
||||
return { teamId, renderTeamUrl };
|
||||
}
|
||||
|
||||
export default useTeamContext;
|
||||
Loading…
Add table
Add a link
Reference in a new issue