|
|
|
@ -1,8 +1,11 @@ |
|
|
|
|
import { useSelector } from "react-redux"; |
|
|
|
|
import "./header.style.scss"; |
|
|
|
|
import { configConstants } from "../../_constants"; |
|
|
|
|
import PrimaryButton from "../Button/PrimaryButton"; |
|
|
|
|
import { renderIconButtonLeft } from "../renderIcon"; |
|
|
|
|
import { history } from "../../_helpers"; |
|
|
|
|
|
|
|
|
|
export default function Header({ icon, title, subtitles = [],manager=false }) { |
|
|
|
|
export default function Header({ icon, title, subtitles = [], manager = false, isBack = false }) { |
|
|
|
|
const authentication = useSelector((state) => state.authentication); |
|
|
|
|
const { fullname, organization_name, role } = authentication?.user || {}; |
|
|
|
|
const hasFullName = fullname || organization_name; |
|
|
|
@ -23,6 +26,16 @@ export default function Header({ icon, title, subtitles = [],manager=false }) { |
|
|
|
|
return ( |
|
|
|
|
<div className="header-container"> |
|
|
|
|
<div className="header-left-side"> |
|
|
|
|
{isBack && ( |
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}> |
|
|
|
|
<PrimaryButton style={{ alignSelf: "center", justifyContent:'flex end', marginRight:30 }} onClick={()=>{ |
|
|
|
|
history.goBack() |
|
|
|
|
}}> |
|
|
|
|
<div style={{marginRight: 8, paddingBottom: 4}}>{renderIconButtonLeft()}</div> |
|
|
|
|
Quay lại |
|
|
|
|
</PrimaryButton> |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
{icon} |
|
|
|
|
<p className="header-title"> |
|
|
|
|
{title} |
|
|
|
|