2021-01-07 16:44:24 +00:00
|
|
|
import React, { useEffect } from 'react';
|
2021-01-01 22:55:30 +00:00
|
|
|
// import { CSSTransition } from 'react-transition-group';
|
2020-08-22 22:49:18 +00:00
|
|
|
import tw from 'twin.macro';
|
|
|
|
import FlashMessageRender from '@/components/FlashMessageRender';
|
|
|
|
|
2021-01-07 16:44:24 +00:00
|
|
|
const AdminContentBlock: React.FC<{ title?: string; showFlashKey?: string; className?: string }> = ({ children, title, showFlashKey }) => {
|
|
|
|
useEffect(() => {
|
|
|
|
if (!title) {
|
|
|
|
return;
|
2021-01-01 22:55:30 +00:00
|
|
|
}
|
2020-08-22 22:49:18 +00:00
|
|
|
|
2021-01-07 16:44:24 +00:00
|
|
|
document.title = `Admin | ${title}`;
|
|
|
|
}, [ title ]);
|
2020-08-22 22:49:18 +00:00
|
|
|
|
2021-01-07 16:44:24 +00:00
|
|
|
return (
|
|
|
|
// <CSSTransition timeout={150} classNames={'fade'} appear in>
|
|
|
|
<>
|
|
|
|
{showFlashKey &&
|
|
|
|
<FlashMessageRender byKey={showFlashKey} css={tw`mb-4`}/>
|
|
|
|
}
|
|
|
|
{children}
|
|
|
|
|
|
|
|
{/* <p css={tw`text-center text-neutral-500 text-xs mt-4`}>
|
|
|
|
© 2015 - 2021
|
|
|
|
<a
|
|
|
|
rel={'noopener nofollow noreferrer'}
|
|
|
|
href={'https://pterodactyl.io'}
|
|
|
|
target={'_blank'}
|
|
|
|
css={tw`no-underline text-neutral-500 hover:text-neutral-300`}
|
|
|
|
>
|
|
|
|
Pterodactyl Software
|
|
|
|
</a>
|
|
|
|
</p> */}
|
|
|
|
</>
|
|
|
|
// </CSSTransition>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AdminContentBlock;
|