| 1 | import type { Metadata } from 'next' |
| 2 | import { redirect } |
| 3 | import { resolveProjectContext } |
| 4 | import { projectsService } |
| 5 | |
| 6 | import { createMetadata } |
| 7 | import { ProjectSettingsPageClient } |
| 8 | |
| 9 | export const metadata: |
| 10 | title: 'Project Settings', |
| 11 | description: 'Configure project preferences, defaults, and access.', |
| 12 | openGraph: { |
| 13 | images: ['/api/og?page=Settings'], |
| 14 | }, |
| 15 | twitter: { |
| 16 | images: ['/api/og?page=Settings'], |
| 17 | }, |
| 18 | }) |
| 19 | |
| 20 | export default async function |
| 21 | params, |
| 22 | }: PageProps< |
| 23 | const { org, |
| 24 | const { organization, |
| 25 | org, |
| 26 | projectSlug |
| 27 | ) |
| 28 | |
| 29 | if (!role.authorize |
| 30 | redirect( |
| 31 | `/error/403?message=${encodeURIComponent('You do not have permission to view settings |
| 32 | ) |
| 33 | } |
| 34 | |
| 35 | const canDelete = |
| 36 | |
| 37 | const settings = |
| 38 | organization.id, |
| 39 | project.id |
| 40 | ) |
| 41 | |
| 42 | return ( |
| 43 | <ProjectSettingsPageClient |
| 44 | canDelete={canDelete} |
| 45 | organizationId={organization.id |
| 46 | orgSlug={org} |
| 47 | project={{ |
| 48 | id: project.id |
| 49 | name: project.name |
| 50 | slug: project.slug |
| 51 | dueDate: project.dueDate |
| 52 | }} |
| 53 | settings={settings} |
| 54 | /> |
| 55 | ) |
| 56 | } |