fix: Move content into to frontend directory

Doing this BEFORE the merge prevents a lot of merge conflicts.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-11-11 11:16:18 +01:00
parent 4e18ce38f3
commit 762a0a850e
No known key found for this signature in database
GPG key ID: B97799103358209B
1051 changed files with 0 additions and 35 deletions

View file

@ -0,0 +1,47 @@
/*
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { PropsWithChildren } from 'react'
import React from 'react'
import { LandingLayout } from '../landing-layout/landing-layout'
import { Trans, useTranslation } from 'react-i18next'
import { ShowIf } from '../common/show-if/show-if'
export interface CommonErrorPageProps {
titleI18nKey: string
descriptionI18nKey?: string
}
/**
* Renders a common customizable error page.
*
* @param titleI18nKey The translation key for the title of the error.
* @param descriptionI18nKey The translation key for the description of the error. Property is optional.
* @param children The optional child elements that will be displayed beneath the description.
*/
export const CommonErrorPage: React.FC<PropsWithChildren<CommonErrorPageProps>> = ({
titleI18nKey,
descriptionI18nKey,
children
}) => {
useTranslation()
return (
<LandingLayout>
<div className='text-light d-flex flex-column align-items-center justify-content-center my-5'>
<h1>
<Trans i18nKey={titleI18nKey} />
</h1>
<ShowIf condition={!!descriptionI18nKey}>
<h3>
<Trans i18nKey={descriptionI18nKey} />
</h3>
</ShowIf>
{children}
</div>
</LandingLayout>
)
}