mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 19:36:02 -05:00
21 lines
696 B
TypeScript
21 lines
696 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 ? `${name} | ${title}` : title} {...props}>
|
|
{children}
|
|
</PageContentBlock>
|
|
);
|
|
};
|
|
|
|
export default ServerContentBlock;
|