Files

21 lines
696 B
TypeScript
Raw Permalink Normal View History

2026-10-05 18:10:18 -04:00
import type { PageContentBlockProps } from '@/components/elements/PageContentBlock';
import PageContentBlock from '@/components/elements/PageContentBlock';
import { useCurrentServerName } from '@/api/server/queries';
interface Props extends PageContentBlockProps {
2026-10-05 18:10:18 -04:00
/** Shown after the server name in the document title; omit to leave the title alone. */
title?: string;
}
2026-10-05 18:10:18 -04:00
const ServerContentBlock = ({ title, children, ...props }: Props) => {
2026-10-12 15:16:43 -04:00
const name = useCurrentServerName();
return (
2026-10-12 15:16:43 -04:00
<PageContentBlock title={title && name ? `${name} | ${title}` : title} {...props}>
{children}
</PageContentBlock>
);
};
export default ServerContentBlock;