mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-13 03:43:45 +02:00
Fix rendering when trying to access server from state
This commit is contained in:
19
resources/scripts/components/elements/ServerContentBlock.tsx
Normal file
19
resources/scripts/components/elements/ServerContentBlock.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import useServer from '@/plugins/useServer';
|
||||
import PageContentBlock, { PageContentBlockProps } from '@/components/elements/PageContentBlock';
|
||||
import React from 'react';
|
||||
|
||||
interface Props extends PageContentBlockProps {
|
||||
title: string;
|
||||
}
|
||||
|
||||
const ServerContentBlock: React.FC<Props> = ({ title, children, ...props }) => {
|
||||
const { name } = useServer();
|
||||
|
||||
return (
|
||||
<PageContentBlock title={`${name} | ${title}`} {...props}>
|
||||
{children}
|
||||
</PageContentBlock>
|
||||
);
|
||||
};
|
||||
|
||||
export default ServerContentBlock;
|
||||
Reference in New Issue
Block a user