Updated team and websites tables.

This commit is contained in:
Mike Cao 2024-02-04 21:27:12 -08:00
parent 1a9501d8ce
commit 36f207c97d
2 changed files with 25 additions and 15 deletions

View File

@ -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>

View File

@ -46,7 +46,7 @@ export function WebsitesTable({
</LinkButton>
)}
{allowView && (
<LinkButton href={renderTeamUrl(renderTeamUrl(`/websites/${websiteId}`))}>
<LinkButton href={renderTeamUrl(`/websites/${websiteId}`)}>
<Icon>
<Icons.ArrowRight />
</Icon>