mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-25 08:56:13 +01:00
* Use tRPC for recent groups page * Use tRPC for adding group by URL * Use tRPC for saving visited group * Group context
31 lines
677 B
TypeScript
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>
|
|
}
|