Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions site/src/components/UsersTable/UsersTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import TableBody from "@material-ui/core/TableBody"
import TableCell from "@material-ui/core/TableCell"
import TableHead from "@material-ui/core/TableHead"
import TableRow from "@material-ui/core/TableRow"
import { TableContainer } from "components/TableContainer/TableContainer"
import { FC } from "react"
import * as TypesGen from "../../api/typesGenerated"
import { UsersTableBody } from "./UsersTableBody"
Expand Down Expand Up @@ -37,29 +38,31 @@ export const UsersTable: FC<UsersTableProps> = ({
isLoading,
}) => {
return (
<Table>
<TableHead>
<TableRow>
<TableCell>{Language.usernameLabel}</TableCell>
<TableCell>{Language.statusLabel}</TableCell>
<TableCell>{Language.rolesLabel}</TableCell>
{/* 1% is a trick to make the table cell width fit the content */}
{canEditUsers && <TableCell width="1%" />}
</TableRow>
</TableHead>
<TableBody>
<UsersTableBody
users={users}
roles={roles}
isLoading={isLoading}
canEditUsers={canEditUsers}
isUpdatingUserRoles={isUpdatingUserRoles}
onActivateUser={onActivateUser}
onResetUserPassword={onResetUserPassword}
onSuspendUser={onSuspendUser}
onUpdateUserRoles={onUpdateUserRoles}
/>
</TableBody>
</Table>
<TableContainer>
<Table>
<TableHead>
<TableRow>
<TableCell>{Language.usernameLabel}</TableCell>
<TableCell>{Language.statusLabel}</TableCell>
<TableCell>{Language.rolesLabel}</TableCell>
{/* 1% is a trick to make the table cell width fit the content */}
{canEditUsers && <TableCell width="1%" />}
</TableRow>
</TableHead>
<TableBody>
<UsersTableBody
users={users}
roles={roles}
isLoading={isLoading}
canEditUsers={canEditUsers}
isUpdatingUserRoles={isUpdatingUserRoles}
onActivateUser={onActivateUser}
onResetUserPassword={onResetUserPassword}
onSuspendUser={onSuspendUser}
onUpdateUserRoles={onUpdateUserRoles}
/>
</TableBody>
</Table>
</TableContainer>
)
}