-
Notifications
You must be signed in to change notification settings - Fork 3
/
PageTitle.view.tsx
34 lines (30 loc) · 995 Bytes
/
PageTitle.view.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React, { ReactElement } from 'react';
import { CommonProps } from '@/types/CommonProps';
import { usePageTitleHook } from './PageTitle.hook';
import './PageTitle.less';
export interface PageTitleProps extends CommonProps {
name?: string;
render?: () => ReactElement;
info?: string;
children?: any
}
export const PageTitle = (props: PageTitleProps) => {
const { defaultTitle } = usePageTitleHook(props);
return (
<div className="page-title-view-wrap">
<div className="page-title-view-item">
<h4 className="page-title-view-wrap-name">
{props.name || defaultTitle}
{props.render && props.render()}
{(props.info || !props.render) && (
<div className="page-title-view-wrap-content">
<i className="el-icons-information" />
</div>
)}
</h4>
<div className="page-title-view-wrap-setting">{props.children}</div>
</div>
</div>
);
};
export default PageTitle