mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
Refactored queries.
This commit is contained in:
parent
18e36aa7b3
commit
b16f5cc067
67 changed files with 523 additions and 576 deletions
|
|
@ -6,11 +6,11 @@ import TeamMemberRemoveButton from './TeamMemberRemoveButton';
|
|||
export function TeamMembersTable({
|
||||
data = [],
|
||||
teamId,
|
||||
readOnly,
|
||||
allowEdit,
|
||||
}: {
|
||||
data: any[];
|
||||
teamId: string;
|
||||
readOnly: boolean;
|
||||
allowEdit: boolean;
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { user } = useLogin();
|
||||
|
|
@ -23,16 +23,20 @@ export function TeamMembersTable({
|
|||
|
||||
return (
|
||||
<GridTable data={data} cardMode={['xs', 'sm', 'md'].includes(breakpoint)}>
|
||||
<GridColumn name="username" label={formatMessage(labels.username)} />
|
||||
<GridColumn name="username" label={formatMessage(labels.username)}>
|
||||
{row => row?.user?.username}
|
||||
</GridColumn>
|
||||
<GridColumn name="role" label={formatMessage(labels.role)}>
|
||||
{row => roles[row?.teamUser?.[0]?.role]}
|
||||
{row => roles[row?.role]}
|
||||
</GridColumn>
|
||||
<GridColumn name="action" label=" " alignment="end">
|
||||
{row => {
|
||||
return (
|
||||
!readOnly &&
|
||||
row?.teamUser?.[0]?.role !== ROLES.teamOwner &&
|
||||
user?.id !== row?.id && <TeamMemberRemoveButton teamId={teamId} userId={row.id} />
|
||||
allowEdit &&
|
||||
row?.role !== ROLES.teamOwner &&
|
||||
user?.id !== row?.id && (
|
||||
<TeamMemberRemoveButton teamId={teamId} userId={row?.user?.id} />
|
||||
)
|
||||
);
|
||||
}}
|
||||
</GridColumn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue