mirror of
https://github.com/umami-software/umami.git
synced 2026-02-21 21:15:35 +01:00
Changed route ids to be more explicit.
This commit is contained in:
parent
1a70350936
commit
18e36aa7b3
105 changed files with 86 additions and 76 deletions
|
|
@ -1,43 +0,0 @@
|
|||
import { GridColumn, GridTable, useBreakpoint } from 'react-basics';
|
||||
import { useMessages, useLogin } from 'components/hooks';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import TeamMemberRemoveButton from './TeamMemberRemoveButton';
|
||||
|
||||
export function TeamMembersTable({
|
||||
data = [],
|
||||
teamId,
|
||||
readOnly,
|
||||
}: {
|
||||
data: any[];
|
||||
teamId: string;
|
||||
readOnly: boolean;
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { user } = useLogin();
|
||||
const breakpoint = useBreakpoint();
|
||||
|
||||
const roles = {
|
||||
[ROLES.teamOwner]: formatMessage(labels.teamOwner),
|
||||
[ROLES.teamMember]: formatMessage(labels.teamMember),
|
||||
};
|
||||
|
||||
return (
|
||||
<GridTable data={data} cardMode={['xs', 'sm', 'md'].includes(breakpoint)}>
|
||||
<GridColumn name="username" label={formatMessage(labels.username)} />
|
||||
<GridColumn name="role" label={formatMessage(labels.role)}>
|
||||
{row => roles[row?.teamUser?.[0]?.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} />
|
||||
);
|
||||
}}
|
||||
</GridColumn>
|
||||
</GridTable>
|
||||
);
|
||||
}
|
||||
|
||||
export default TeamMembersTable;
|
||||
Loading…
Add table
Add a link
Reference in a new issue