mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 18:25:21 -04:00
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:
parent
4e18ce38f3
commit
762a0a850e
1051 changed files with 0 additions and 35 deletions
47
frontend/src/components/error-pages/common-error-page.tsx
Normal file
47
frontend/src/components/error-pages/common-error-page.tsx
Normal 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>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue