tianji/src/client/components/PageHeader.tsx

26 lines
640 B
TypeScript
Raw Normal View History

2024-02-28 14:28:12 +00:00
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Tooltip } from 'antd';
import React from 'react';
export const PageHeader: React.FC<{
title: string;
2024-02-28 14:28:12 +00:00
desc?: React.ReactNode;
action?: React.ReactNode;
}> = React.memo((props) => {
return (
2024-03-22 16:45:21 +00:00
<div className="flex h-24 items-center">
<div className="flex-1 text-2xl">
2024-02-28 14:28:12 +00:00
{props.title}
{props.desc && (
<Tooltip title={props.desc}>
2024-03-22 16:45:21 +00:00
<QuestionCircleOutlined className="ml-2 cursor-help text-sm" />
2024-02-28 14:28:12 +00:00
</Tooltip>
)}
</div>
{props.action}
</div>
);
});
PageHeader.displayName = 'PageHeader';