| 1 | import { headers } from 'next/headers' |
| 2 | import { redirect } |
| 3 | import { ApplicationHeader } |
| 4 | import { FloatingTimer } |
| 5 | import { Separator } |
| 6 | import { authClient } |
| 7 | import { getCachedOrganization, getCachedUserSession |
| 8 | import OrgNavServer from './nav.server |
| 9 | |
| 10 | export default async function |
| 11 | children, |
| 12 | params, |
| 13 | }: LayoutProps< |
| 14 | const { org |
| 15 | const session = |
| 16 | if (!session) |
| 17 | return redirect(`/auth/sign-in?redirectTo= |
| 18 | } |
| 19 | const organization = |
| 20 | |
| 21 | if (!organization) |
| 22 | redirect(`/error/404?message=${encodeURIComponent |
| 23 | } |
| 24 | |
| 25 | const allOrganizations = |
| 26 | {}, |
| 27 | { headers: await |
| 28 | ) |
| 29 | |
| 30 | return ( |
| 31 | <div className='flex flex-1 flex-col |
| 32 | <header className='flex w-full shrink-0 flex-col items-center bg-secondary transition-[width,height] ease-linear |
| 33 | <div className='flex w-full items-center gap-2 px-4 |
| 34 | <ApplicationHeader |
| 35 | allOrganizations={allOrganizations.data |
| 36 | allProjects={[]} |
| 37 | organizationId={organization?.id |
| 38 | organizationName={organization?.name |
| 39 | organizationSlug={org} |
| 40 | projectName={null} |
| 41 | /> |
| 42 | </div> |
| 43 | <Separator className=' |
| 44 | |
| 45 | <OrgNavServer slug={ |
| 46 | </header> |
| 47 | <div className='flex w-full items-center justify-center |
| 48 | <div className='flex max-w-7xl flex-1 items-center justify-center p-4 |
| 49 | {children} |
| 50 | </div> |
| 51 | </div> |
| 52 | <FloatingTimer /> |
| 53 | </div> |
| 54 | ) |
| 55 | } |