Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Replaced suite page metadata with drive-specific metadata for document and drawing editors. - Introduced new `driveEditorPageMetadata` function to manage titles and favicons based on editor type. - Updated layout components for document and drawing editors to utilize the new metadata structure. - Enhanced document title handling in various editor components to reflect the current editing context. - Added new SVG icons for UltiDocs, UltiSheets, UltiSlides, and UltiDraw to improve visual consistency across editors. - Improved print styles and layout handling for better document rendering in print and PDF formats.
23 lines
819 B
TypeScript
23 lines
819 B
TypeScript
import type { Metadata } from "next"
|
|
import { displayFileBaseName } from "@/lib/drive/display-file-name"
|
|
import { driveEditorPageMetadata } from "@/lib/drive/drive-editor-metadata"
|
|
import { resolveOnlyOfficeEditorKind } from "@/lib/drive/onlyoffice-formats"
|
|
|
|
type LayoutProps = {
|
|
children: React.ReactNode
|
|
params: Promise<{ fileId: string }>
|
|
}
|
|
|
|
export async function generateMetadata({ params }: LayoutProps): Promise<Metadata> {
|
|
const { fileId } = await params
|
|
const raw = decodeURIComponent(fileId)
|
|
const baseName = raw.split("/").filter(Boolean).pop() ?? raw
|
|
const name = displayFileBaseName(baseName)
|
|
const kind = resolveOnlyOfficeEditorKind({ name: baseName })
|
|
return driveEditorPageMetadata(kind, name)
|
|
}
|
|
|
|
export default function EditLayout({ children }: LayoutProps) {
|
|
return <>{children}</>
|
|
}
|