Files
pterodactyl-panel/resources/scripts/components/elements/PageContentBlock.tsx
T

37 lines
1.3 KiB
TypeScript
Raw Normal View History

2020-12-27 11:18:33 -08:00
import React, { useEffect } from 'react';
import ContentContainer from '@/components/elements/ContentContainer';
2026-10-05 18:10:18 -04:00
import { cn } from '@/lib/cn';
export interface PageContentBlockProps {
title?: string;
className?: string;
2026-10-05 18:10:18 -04:00
children?: React.ReactNode;
}
2026-10-05 18:10:18 -04:00
const PageContentBlock = ({ title, className, children }: PageContentBlockProps) => {
2020-12-27 11:18:33 -08:00
useEffect(() => {
2026-10-05 18:10:18 -04:00
document.title = title || document.title;
}, [title]);
2020-12-27 11:18:33 -08:00
return (
2026-10-05 18:10:18 -04:00
<div>
<ContentContainer className={cn('my-4 sm:my-6', className)}>{children}</ContentContainer>
<ContentContainer className={'mb-4'}>
<p className={'text-center text-muted-foreground text-xs'}>
<a
rel={'noopener nofollow noreferrer'}
href={'https://pterodactyl.io'}
target={'_blank'}
className={'no-underline text-muted-foreground hover:text-muted-foreground'}
>
Pterodactyl&reg;
</a>
&nbsp;&copy; 2015 - <span suppressHydrationWarning>{new Date().getFullYear()}</span>
</p>
</ContentContainer>
</div>
);
};
2020-07-04 09:28:03 -07:00
export default PageContentBlock;