ts fixes
This commit is contained in:
parent
f3d588c0eb
commit
eda977b203
4 changed files with 12 additions and 8 deletions
|
@ -14,7 +14,7 @@ type Props = RadixTabs.TabsProps & {
|
|||
onPaste?: (e: ClipboardEvent<HTMLTextAreaElement>) => void
|
||||
title?: string
|
||||
staticPreview?: string
|
||||
children: string;
|
||||
children: string
|
||||
}
|
||||
|
||||
export default function DocumentTabs({
|
||||
|
@ -83,9 +83,11 @@ export default function DocumentTabs({
|
|||
</RadixTabs.Content>
|
||||
<RadixTabs.Content value="preview">
|
||||
{isEditing ? (
|
||||
<Preview height={"100%"} title={title}>{children}</Preview>
|
||||
<Preview height={"100%"} title={title}>
|
||||
{children}
|
||||
</Preview>
|
||||
) : (
|
||||
<StaticPreview height={"100%"}>{preview}</StaticPreview>
|
||||
<StaticPreview height={"100%"}>{preview || ""}</StaticPreview>
|
||||
)}
|
||||
</RadixTabs.Content>
|
||||
</RadixTabs.Root>
|
||||
|
|
|
@ -106,16 +106,17 @@ const Document = ({ skeleton, ...props }: Props) => {
|
|||
>
|
||||
{title}
|
||||
</Link>
|
||||
{/* Not /api/ because of rewrites defined in next.config.mjs */}
|
||||
<DownloadButtons rawLink={`/file/raw/${id}`} />
|
||||
</header>
|
||||
<div className={styles.documentContainer}>
|
||||
{/* Not /api/ because of rewrites defined in next.config.mjs */}
|
||||
<DocumentTabs
|
||||
defaultTab={initialTab}
|
||||
staticPreview={preview}
|
||||
content={content}
|
||||
isEditing={false}
|
||||
/>
|
||||
>
|
||||
{content || ""}
|
||||
</DocumentTabs>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
@ -17,7 +17,7 @@ const actions = [
|
|||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const { action: requestedAction } = req.query
|
||||
const action = parseQueryParam(requestedAction) as typeof actions[number]
|
||||
const action = parseQueryParam(requestedAction) as (typeof actions)[number]
|
||||
|
||||
if (!action || !actions.includes(action)) {
|
||||
res.status(400).json({ error: "Invalid action" })
|
||||
|
|
|
@ -135,7 +135,8 @@ export default async function handler(req: NextRequest) {
|
|||
),
|
||||
{
|
||||
width: WIDTH,
|
||||
height: HEIGHT,
|
||||
height: HEIGHT
|
||||
|
||||
// debug: true
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue