Skip to content

Commit e2cdf22

Browse files
committed
chore: migrate to shadcn table
1 parent 5285c12 commit e2cdf22

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

site/src/pages/GroupsPage/GroupsPageView.tsx

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ import AddOutlined from "@mui/icons-material/AddOutlined";
33
import KeyboardArrowRight from "@mui/icons-material/KeyboardArrowRight";
44
import AvatarGroup from "@mui/material/AvatarGroup";
55
import Skeleton from "@mui/material/Skeleton";
6-
import Table from "@mui/material/Table";
7-
import TableBody from "@mui/material/TableBody";
8-
import TableCell from "@mui/material/TableCell";
9-
import TableContainer from "@mui/material/TableContainer";
10-
import TableHead from "@mui/material/TableHead";
11-
import TableRow from "@mui/material/TableRow";
126
import type { Group } from "api/typesGenerated";
137
import { Avatar } from "components/Avatar/Avatar";
148
import { AvatarData } from "components/Avatar/AvatarData";
@@ -17,6 +11,14 @@ import { Button } from "components/Button/Button";
1711
import { ChooseOne, Cond } from "components/Conditionals/ChooseOne";
1812
import { EmptyState } from "components/EmptyState/EmptyState";
1913
import { Paywall } from "components/Paywall/Paywall";
14+
import {
15+
Table,
16+
TableBody,
17+
TableCell,
18+
TableHead,
19+
TableHeader,
20+
TableRow,
21+
} from "components/Table/Table";
2022
import {
2123
TableLoaderSkeleton,
2224
TableRowSkeleton,
@@ -51,55 +53,53 @@ export const GroupsPageView: FC<GroupsPageViewProps> = ({
5153
/>
5254
</Cond>
5355
<Cond>
54-
<TableContainer>
55-
<Table>
56-
<TableHead>
57-
<TableRow>
58-
<TableCell width="50%">Name</TableCell>
59-
<TableCell width="49%">Users</TableCell>
60-
<TableCell width="1%" />
61-
</TableRow>
62-
</TableHead>
63-
<TableBody>
64-
<ChooseOne>
65-
<Cond condition={isLoading}>
66-
<TableLoader />
67-
</Cond>
56+
<Table>
57+
<TableHeader>
58+
<TableRow>
59+
<TableHead className="w-1/2">Name</TableHead>
60+
<TableHead className="w-[49%]">Users</TableHead>
61+
<TableHead className="w-[1%]" />
62+
</TableRow>
63+
</TableHeader>
64+
<TableBody>
65+
<ChooseOne>
66+
<Cond condition={isLoading}>
67+
<TableLoader />
68+
</Cond>
6869

69-
<Cond condition={isEmpty}>
70-
<TableRow>
71-
<TableCell colSpan={999}>
72-
<EmptyState
73-
message="No groups yet"
74-
description={
75-
canCreateGroup
76-
? "Create your first group"
77-
: "You don't have permission to create a group"
78-
}
79-
cta={
80-
canCreateGroup && (
81-
<Button asChild>
82-
<RouterLink to="create">
83-
<AddOutlined />
84-
Create group
85-
</RouterLink>
86-
</Button>
87-
)
88-
}
89-
/>
90-
</TableCell>
91-
</TableRow>
92-
</Cond>
70+
<Cond condition={isEmpty}>
71+
<TableRow>
72+
<TableCell colSpan={999}>
73+
<EmptyState
74+
message="No groups yet"
75+
description={
76+
canCreateGroup
77+
? "Create your first group"
78+
: "You don't have permission to create a group"
79+
}
80+
cta={
81+
canCreateGroup && (
82+
<Button asChild>
83+
<RouterLink to="create">
84+
<AddOutlined />
85+
Create group
86+
</RouterLink>
87+
</Button>
88+
)
89+
}
90+
/>
91+
</TableCell>
92+
</TableRow>
93+
</Cond>
9394

94-
<Cond>
95-
{groups?.map((group) => (
96-
<GroupRow key={group.id} group={group} />
97-
))}
98-
</Cond>
99-
</ChooseOne>
100-
</TableBody>
101-
</Table>
102-
</TableContainer>
95+
<Cond>
96+
{groups?.map((group) => (
97+
<GroupRow key={group.id} group={group} />
98+
))}
99+
</Cond>
100+
</ChooseOne>
101+
</TableBody>
102+
</Table>
103103
</Cond>
104104
</ChooseOne>
105105
</>

0 commit comments

Comments
 (0)