mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-01 20:39:44 +01:00
Updated team and websites tables.
This commit is contained in:
parent
1a9501d8ce
commit
36f207c97d
@ -5,7 +5,15 @@ import Icons from 'components/icons';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import LinkButton from 'components/common/LinkButton';
|
||||
|
||||
export function TeamsTable({ data = [] }: { data: any[] }) {
|
||||
export function TeamsTable({
|
||||
data = [],
|
||||
allowEdit = true,
|
||||
showActions = true,
|
||||
}: {
|
||||
data: any[];
|
||||
allowEdit?: boolean;
|
||||
showActions?: boolean;
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { user } = useLogin();
|
||||
const breakpoint = useBreakpoint();
|
||||
@ -29,9 +37,10 @@ export function TeamsTable({ data = [] }: { data: any[] }) {
|
||||
const isOwner = user.id === owner?.userId;
|
||||
|
||||
return (
|
||||
showActions && (
|
||||
<>
|
||||
{isOwner && (
|
||||
<LinkButton href={`/settings/teams/${id}`}>
|
||||
{allowEdit && isOwner && (
|
||||
<LinkButton href={`/teams/${id}/settings`}>
|
||||
<Icon>
|
||||
<Icons.Edit />
|
||||
</Icon>
|
||||
@ -45,6 +54,7 @@ export function TeamsTable({ data = [] }: { data: any[] }) {
|
||||
<Text>{formatMessage(labels.switch)}</Text>
|
||||
</LinkButton>
|
||||
</>
|
||||
)
|
||||
);
|
||||
}}
|
||||
</GridColumn>
|
||||
|
@ -46,7 +46,7 @@ export function WebsitesTable({
|
||||
</LinkButton>
|
||||
)}
|
||||
{allowView && (
|
||||
<LinkButton href={renderTeamUrl(renderTeamUrl(`/websites/${websiteId}`))}>
|
||||
<LinkButton href={renderTeamUrl(`/websites/${websiteId}`)}>
|
||||
<Icon>
|
||||
<Icons.ArrowRight />
|
||||
</Icon>
|
||||
|
Loading…
Reference in New Issue
Block a user