import { GroupTabs } from '@/app/groups/[groupId]/group-tabs' import { SaveGroupLocally } from '@/app/groups/[groupId]/save-recent-group' import { ShareButton } from '@/app/groups/[groupId]/share-button' import { getGroup } from '@/lib/api' import { Metadata } from 'next' import Link from 'next/link' import { notFound } from 'next/navigation' import { PropsWithChildren, ReactNode } from 'react' type Props = { params: { groupId: string } modal: ReactNode } export async function generateMetadata({ params: { groupId }, }: Props): Promise { const group = await getGroup(groupId) return { title: { default: group?.name ?? '', template: `%s · ${group?.name} · Spliit`, }, } } export default async function GroupLayout({ children, modal, params: { groupId }, }: PropsWithChildren) { const group = await getGroup(groupId) if (!group) notFound() return ( <>

{group.name}

{children} {modal} ) }