mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
My plugins used the antd pageheader more than base did. I did not notice that these features dissappeared when we migrated from antd to our own implementation - this brings them back
20 lines
584 B
TypeScript
20 lines
584 B
TypeScript
import React from "react";
|
|
import { Space, Typography } from "antd";
|
|
const { Text } = Typography;
|
|
|
|
type PageHeaderProps = {
|
|
title: string | React.ReactElement;
|
|
subTitle?: string | React.ReactElement;
|
|
extra?: React.JSX.Element;
|
|
};
|
|
|
|
export default function PageHeader(props: PageHeaderProps): React.JSX.Element {
|
|
return <div className="page-header">
|
|
<Space>
|
|
<h2 className="page-header-title">{props.title}</h2>
|
|
{props.subTitle && <Text type="secondary">{props.subTitle}</Text>}
|
|
</Space>
|
|
{props.extra && <div className="page-header-extra">{props.extra}</div>}
|
|
</div>;
|
|
}
|