mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
21 lines
693 B
TypeScript
21 lines
693 B
TypeScript
import type { PageContentBlockProps } from '@/components/elements/PageContentBlock';
|
|
import PageContentBlock from '@/components/elements/PageContentBlock';
|
|
import { useCurrentServerName } from '@/api/server/queries';
|
|
|
|
interface Props extends PageContentBlockProps {
|
|
/** Shown after the server name in the document title; omit to leave the title alone. */
|
|
title?: string;
|
|
}
|
|
|
|
const ServerContentBlock = ({ title, children, ...props }: Props) => {
|
|
const name = useCurrentServerName()!;
|
|
|
|
return (
|
|
<PageContentBlock title={title ? `${name} | ${title}` : undefined} {...props}>
|
|
{children}
|
|
</PageContentBlock>
|
|
);
|
|
};
|
|
|
|
export default ServerContentBlock;
|