aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/groups/page.tsx
diff options
context:
space:
mode:
authorSebastien Castiel <sebastien@castiel.me>2023-12-07 20:54:11 -0500
committerSebastien Castiel <sebastien@castiel.me>2023-12-07 20:57:48 -0500
commit0e7b879aa8d771b58fc5783f78f981cb29432361 (patch)
tree30d04a9c8894bc2215abbfb9dfdc32dcd06f4349 /src/app/groups/page.tsx
parent6f077f141edcc45f2d7467b7c796e62a8f0316f8 (diff)
Redesign the groups page
Diffstat (limited to 'src/app/groups/page.tsx')
-rw-r--r--src/app/groups/page.tsx26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/app/groups/page.tsx b/src/app/groups/page.tsx
index 86c63ac..0c46d99 100644
--- a/src/app/groups/page.tsx
+++ b/src/app/groups/page.tsx
@@ -1,5 +1,7 @@
import { RecentGroupList } from '@/app/groups/recent-group-list'
import { Button } from '@/components/ui/button'
+import { getGroups } from '@/lib/api'
+import { Plus } from 'lucide-react'
import { Metadata } from 'next'
import Link from 'next/link'
@@ -8,15 +10,25 @@ export const metadata: Metadata = {
}
export default async function GroupsPage() {
+ async function getGroupsAction(groupIds: string[]) {
+ 'use server'
+ return getGroups(groupIds)
+ }
+
return (
<main>
- <h1 className="font-bold text-2xl mb-4">
- <Link href="/groups">Recently visited groups</Link>
- </h1>
- <Button asChild>
- <Link href="/groups/create">New group</Link>
- </Button>
- <RecentGroupList />
+ <div className="flex flex-col sm:flex-row sm:justify-between sm:items-baseline mb-2">
+ <h1 className="font-bold text-2xl mb-4">
+ <Link href="/groups">Recently visited groups</Link>
+ </h1>
+ <Button asChild>
+ <Link href="/groups/create">
+ <Plus className="w-4 h-4 mr-2" />
+ Create group
+ </Link>
+ </Button>
+ </div>
+ <RecentGroupList getGroupsAction={getGroupsAction} />
</main>
)
}