Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Added SessionGuard component to manage session expiration and online status. - Updated AuthProvider to streamline session fetching and handling. - Introduced IdentityProvidersSection for managing OAuth, SAML, and LDAP identity providers. - Implemented identity provider guides for easier configuration. - Enhanced mail settings with infinite scroll option for improved user experience. - Updated global styles and layout components for better consistency across the application.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
"use client"
|
|
|
|
import { useParams, useSearchParams } from "next/navigation"
|
|
import { useState } from "react"
|
|
import { PublicOfficeEditor } from "@/components/drive/public-office-editor"
|
|
import { filePathFromPublicEditSegments } from "@/lib/drive/public-share-url"
|
|
|
|
export default function PublicShareEditPage() {
|
|
const params = useParams()
|
|
const searchParams = useSearchParams()
|
|
const token = String(params.token ?? "")
|
|
const pathSegments = params.path as string[] | undefined
|
|
const filePath = filePathFromPublicEditSegments(token, pathSegments)
|
|
const returnTo = searchParams.get("returnTo")
|
|
const mode = searchParams.get("mode") === "view" ? "view" : "edit"
|
|
const fileDisplayName = searchParams.get("name") ?? undefined
|
|
const [password] = useState<string | undefined>(() => {
|
|
if (typeof window === "undefined") return undefined
|
|
return sessionStorage.getItem(`public-share-pw:${token}`) ?? undefined
|
|
})
|
|
|
|
return (
|
|
<PublicOfficeEditor
|
|
token={token}
|
|
filePath={filePath}
|
|
password={password}
|
|
returnTo={returnTo}
|
|
mode={mode}
|
|
fileDisplayName={fileDisplayName}
|
|
/>
|
|
)
|
|
}
|