Path: blob/1.0-develop/resources/scripts/components/elements/PageContentBlock.tsx
7461 views
import React, { useEffect } from 'react';1import ContentContainer from '@/components/elements/ContentContainer';2import { CSSTransition } from 'react-transition-group';3import tw from 'twin.macro';4import FlashMessageRender from '@/components/FlashMessageRender';56export interface PageContentBlockProps {7title?: string;8className?: string;9showFlashKey?: string;10}1112const PageContentBlock: React.FC<PageContentBlockProps> = ({ title, showFlashKey, className, children }) => {13useEffect(() => {14if (title) {15document.title = title;16}17}, [title]);1819return (20<CSSTransition timeout={150} classNames={'fade'} appear in>21<>22<ContentContainer css={tw`my-4 sm:my-10`} className={className}>23{showFlashKey && <FlashMessageRender byKey={showFlashKey} css={tw`mb-4`} />}24{children}25</ContentContainer>26<ContentContainer css={tw`mb-4`}>27<p css={tw`text-center text-neutral-500 text-xs`}>28<a29rel={'noopener nofollow noreferrer'}30href={'https://pterodactyl.io'}31target={'_blank'}32css={tw`no-underline text-neutral-500 hover:text-neutral-300`}33>34Pterodactyl®35</a>36 © 2015 - {new Date().getFullYear()}37</p>38</ContentContainer>39</>40</CSSTransition>41);42};4344export default PageContentBlock;454647