2022-11-25 20:25:03 +00:00
|
|
|
import type { ReactNode } from 'react';
|
|
|
|
import { useEffect } from 'react';
|
2020-07-03 21:50:37 +00:00
|
|
|
import tw from 'twin.macro';
|
2022-11-25 20:25:03 +00:00
|
|
|
|
|
|
|
import ContentContainer from '@/components/elements/ContentContainer';
|
2020-07-10 02:56:46 +00:00
|
|
|
import FlashMessageRender from '@/components/FlashMessageRender';
|
2020-04-17 18:07:32 +00:00
|
|
|
|
2020-08-23 02:05:43 +00:00
|
|
|
export interface PageContentBlockProps {
|
2022-11-25 20:25:03 +00:00
|
|
|
children?: ReactNode;
|
|
|
|
|
2020-08-22 22:43:28 +00:00
|
|
|
title?: string;
|
|
|
|
className?: string;
|
|
|
|
showFlashKey?: string;
|
|
|
|
}
|
|
|
|
|
2022-11-25 20:25:03 +00:00
|
|
|
function PageContentBlock({ title, showFlashKey, className, children }: PageContentBlockProps) {
|
2020-12-27 19:18:33 +00:00
|
|
|
useEffect(() => {
|
|
|
|
if (title) {
|
|
|
|
document.title = title;
|
|
|
|
}
|
2022-06-26 19:13:52 +00:00
|
|
|
}, [title]);
|
2020-12-27 19:18:33 +00:00
|
|
|
|
2020-08-22 22:43:28 +00:00
|
|
|
return (
|
2022-11-25 20:25:03 +00:00
|
|
|
<>
|
|
|
|
<ContentContainer css={tw`my-4 sm:my-10`} className={className}>
|
|
|
|
{showFlashKey && <FlashMessageRender byKey={showFlashKey} css={tw`mb-4`} />}
|
|
|
|
{children}
|
|
|
|
</ContentContainer>
|
|
|
|
|
|
|
|
<ContentContainer css={tw`mb-4`}>
|
|
|
|
<p css={tw`text-center text-neutral-500 text-xs`}>
|
|
|
|
<a
|
|
|
|
rel={'noopener nofollow noreferrer'}
|
|
|
|
href={'https://pterodactyl.io'}
|
|
|
|
target={'_blank'}
|
|
|
|
css={tw`no-underline text-neutral-500 hover:text-neutral-300`}
|
|
|
|
>
|
|
|
|
Pterodactyl®
|
|
|
|
</a>
|
|
|
|
© 2015 - {new Date().getFullYear()}
|
|
|
|
</p>
|
|
|
|
</ContentContainer>
|
|
|
|
</>
|
2020-08-22 22:43:28 +00:00
|
|
|
);
|
2022-11-25 20:25:03 +00:00
|
|
|
}
|
2020-07-04 16:28:03 +00:00
|
|
|
|
|
|
|
export default PageContentBlock;
|