misc_pterodactyl-panel/resources/scripts/components/elements/ServerContentBlock.tsx

20 lines
588 B
TypeScript
Raw Normal View History

import PageContentBlock, { PageContentBlockProps } from '@/components/elements/PageContentBlock';
2022-11-25 20:25:03 +00:00
import * as React from 'react';
import { ServerContext } from '@/state/server';
interface Props extends PageContentBlockProps {
title: string;
}
const ServerContentBlock: React.FC<Props> = ({ title, children, ...props }) => {
2022-11-25 20:25:03 +00:00
const name = ServerContext.useStoreState(state => state.server.data!.name);
return (
<PageContentBlock title={`${name} | ${title}`} {...props}>
{children}
</PageContentBlock>
);
};
export default ServerContentBlock;