hedgedoc/frontend/src/components/document-read-only-page/document-read-only-page-content.tsx
Tilman Vatteroth e390c0dd15 fix(frontend): reformat source files
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-04 20:59:46 +01:00

36 lines
1.4 KiB
TypeScript

/*
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { useTrimmedNoteMarkdownContentWithoutFrontmatter } from '../../hooks/common/use-trimmed-note-markdown-content-without-frontmatter'
import { updateNoteTitleByFirstHeading } from '../../redux/note-details/methods'
import { setRendererStatus } from '../../redux/renderer-status/methods'
import { RenderIframe } from '../editor-page/renderer-pane/render-iframe'
import { RendererType } from '../render-page/window-post-message-communicator/rendering-message'
import { DocumentInfobar } from './document-infobar'
import React, { Fragment } from 'react'
import { useTranslation } from 'react-i18next'
/**
* Renders the read-only version of a note with a header bar that contains information about the note.
*/
export const DocumentReadOnlyPageContent: React.FC = () => {
useTranslation()
const markdownContentLines = useTrimmedNoteMarkdownContentWithoutFrontmatter()
// TODO Change todo values with real ones as soon as the backend is ready.
return (
<Fragment>
<DocumentInfobar />
<RenderIframe
frameClasses={'flex-fill h-100 w-100'}
markdownContentLines={markdownContentLines}
onFirstHeadingChange={updateNoteTitleByFirstHeading}
rendererType={RendererType.DOCUMENT}
onRendererStatusChange={setRendererStatus}
/>
</Fragment>
)
}