2024-03-23 11:38:39 +00:00
|
|
|
import React from 'react';
|
2024-03-25 13:53:43 +00:00
|
|
|
import { TipIcon } from './TipIcon';
|
2024-03-23 11:38:39 +00:00
|
|
|
|
|
|
|
interface CommonHeaderProps {
|
|
|
|
title: string;
|
2024-03-25 13:53:43 +00:00
|
|
|
desc?: React.ReactNode;
|
2024-03-23 11:38:39 +00:00
|
|
|
actions?: React.ReactNode;
|
|
|
|
}
|
|
|
|
export const CommonHeader: React.FC<CommonHeaderProps> = React.memo((props) => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<h1 className="text-xl font-bold">{props.title}</h1>
|
|
|
|
|
2024-03-25 13:53:43 +00:00
|
|
|
{props.desc && <TipIcon className="ml-1" content={props.desc} />}
|
|
|
|
|
2024-03-23 11:38:39 +00:00
|
|
|
{props.actions && <div className="ml-auto">{props.actions}</div>}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
CommonHeader.displayName = 'CommonHeader';
|