mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 03:55:37 +01:00
Teams context settings.
This commit is contained in:
parent
4429198397
commit
8f853ddb97
77 changed files with 317 additions and 272 deletions
26
src/app/(main)/teams/[teamId]/settings/team/Team.tsx
Normal file
26
src/app/(main)/teams/[teamId]/settings/team/Team.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
'use client';
|
||||
import TeamEditForm from 'app/(main)/settings/teams/[teamId]/TeamEditForm';
|
||||
import { useLogin, useMessages, useTeam } from 'components/hooks';
|
||||
import { Loading } from 'react-basics';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import { ROLES } from 'lib/constants';
|
||||
|
||||
export default function Team({ teamId }: { teamId: string }) {
|
||||
const { user } = useLogin();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { data: team, isLoading } = useTeam(teamId);
|
||||
const allowEdit = !!team?.teamUser?.find(
|
||||
({ userId, role }) => role === ROLES.teamOwner && userId === user.id,
|
||||
);
|
||||
|
||||
if (isLoading) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHeader title={formatMessage(labels.team)} />
|
||||
<TeamEditForm teamId={teamId} data={team} allowEdit={allowEdit} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
5
src/app/(main)/teams/[teamId]/settings/team/page.tsx
Normal file
5
src/app/(main)/teams/[teamId]/settings/team/page.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import Team from './Team';
|
||||
|
||||
export default function ({ params: { teamId } }) {
|
||||
return <Team teamId={teamId} />;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue