Files
factorio-clusterio/packages/web_ui/src/components/PageHeader.tsx
T
Danielv123 51657bea44 Extend PageHeader for plugins
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
2024-06-14 19:19:42 +02:00

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>;
}