-
Notifications
You must be signed in to change notification settings - Fork 5
/
view.tsx
35 lines (31 loc) · 1.07 KB
/
view.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Divider, Box, Button, Flex } from "@mantine/core"
import useModals from "~/hooks/useModals"
import { Account, RoleName, User } from "~/models/portal/sdk"
import InviteMemberFrom from "~/routes/account.$accountId.settings.members/components/InviteMemberForm"
import TeamMembersTable from "~/routes/account.$accountId.settings.members/components/TeamMembersTable"
type TeamViewProps = {
account: Account
userRole: RoleName
user: User
}
function MembersView({ account, userRole, user }: TeamViewProps) {
const { openFullScreenModal } = useModals()
const openInviteMemberModal = () =>
openFullScreenModal({
children: <InviteMemberFrom accountName={account.name} />,
})
return (
<Box>
<Flex align="center" justify="flex-end" my="xl">
{userRole !== RoleName.Member && (
<Button size="md" onClick={openInviteMemberModal}>
Invite new member
</Button>
)}
</Flex>
<Divider />
<TeamMembersTable account={account} user={user} userRole={userRole} />
</Box>
)
}
export default MembersView