ultisuite-client/app/drive/edit/[fileId]/page.tsx
R3D347HR4Y cdff12490a
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
hocuspocus
2026-06-09 14:31:07 +02:00

24 lines
876 B
TypeScript

"use client"
import { useParams, useSearchParams } from "next/navigation"
import { OfficeEditor } from "@/components/drive/office-editor"
import { RichTextEditor } from "@/components/drive/richtext-editor"
import { shouldOpenInRichTextEditor } from "@/lib/drive/drive-preview"
export default function DriveEditPage() {
const params = useParams()
const searchParams = useSearchParams()
const filePath = decodeURIComponent(params.fileId as string)
const returnTo = searchParams.get("returnTo")
const editorParam = searchParams.get("editor")
const fileName = filePath.split("/").pop() ?? filePath
const useRichText =
editorParam === "richtext" || shouldOpenInRichTextEditor({ name: fileName })
if (useRichText) {
return <RichTextEditor filePath={filePath} returnTo={returnTo} />
}
return <OfficeEditor filePath={filePath} returnTo={returnTo} />
}