mirror of
https://github.com/umami-software/umami.git
synced 2026-02-25 06:55:35 +01:00
Fixed teams settings.
This commit is contained in:
parent
9104332623
commit
b0c9197f2d
21 changed files with 40 additions and 2 deletions
|
|
@ -0,0 +1,30 @@
|
|||
'use client';
|
||||
import { TeamContext } from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
import WebsiteAddButton from 'app/(main)/settings/websites/WebsiteAddButton';
|
||||
import { useLogin, useMessages } from 'components/hooks';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import TeamWebsitesDataTable from './TeamWebsitesDataTable';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import { useContext } from 'react';
|
||||
|
||||
export function TeamWebsitesPage({ teamId }: { teamId: string }) {
|
||||
const team = useContext(TeamContext);
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { user } = useLogin();
|
||||
|
||||
const canEdit =
|
||||
!!team?.teamUser?.find(
|
||||
({ userId, role }) => userId === user.id && role !== ROLES.teamViewOnly,
|
||||
) && user.role !== ROLES.viewOnly;
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHeader title={formatMessage(labels.websites)}>
|
||||
{canEdit && <WebsiteAddButton teamId={teamId} />}
|
||||
</PageHeader>
|
||||
<TeamWebsitesDataTable teamId={teamId} allowEdit={canEdit} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default TeamWebsitesPage;
|
||||
Loading…
Add table
Add a link
Reference in a new issue