Files
spliit/src/app/groups/[groupId]/layout.tsx
Sebastien Castiel 4db788680e Use tRPC for recent groups page (#253)
* Use tRPC for recent groups page

* Use tRPC for adding group by URL

* Use tRPC for saving visited group

* Group context
2024-10-20 17:50:52 -04:00

31 lines
677 B
TypeScript

import { cached } from '@/app/cached-functions'
import { Metadata } from 'next'
import { PropsWithChildren } from 'react'
import { GroupLayoutClient } from './layout.client'
type Props = {
params: {
groupId: string
}
}
export async function generateMetadata({
params: { groupId },
}: Props): Promise<Metadata> {
const group = await cached.getGroup(groupId)
return {
title: {
default: group?.name ?? '',
template: `%s · ${group?.name} · Spliit`,
},
}
}
export default function GroupLayout({
children,
params: { groupId },
}: PropsWithChildren<Props>) {
return <GroupLayoutClient groupId={groupId}>{children}</GroupLayoutClient>
}