2023-01-26 18:12:20 +00:00
|
|
|
// icons
|
|
|
|
import { Bars3Icon } from "@heroicons/react/24/outline";
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
breadcrumbs?: JSX.Element;
|
|
|
|
left?: JSX.Element;
|
|
|
|
right?: JSX.Element;
|
|
|
|
setToggleSidebar: React.Dispatch<React.SetStateAction<boolean>>;
|
2023-06-24 12:42:11 +00:00
|
|
|
noHeader: boolean;
|
2023-01-26 18:12:20 +00:00
|
|
|
};
|
|
|
|
|
2023-06-24 12:42:11 +00:00
|
|
|
const Header: React.FC<Props> = ({ breadcrumbs, left, right, setToggleSidebar, noHeader }) => (
|
|
|
|
<div
|
2023-07-31 11:52:48 +00:00
|
|
|
className={`relative flex w-full flex-shrink-0 flex-row z-10 items-center justify-between gap-x-2 gap-y-4 border-b border-custom-border-200 bg-custom-sidebar-background-100 px-5 py-4 ${
|
2023-06-24 12:42:11 +00:00
|
|
|
noHeader ? "md:hidden" : ""
|
|
|
|
}`}
|
|
|
|
>
|
2023-07-31 11:52:48 +00:00
|
|
|
<div className="flex items-center gap-2 flex-grow w-full whitespace-nowrap overflow-ellipsis">
|
2023-01-31 13:54:45 +00:00
|
|
|
<div className="block md:hidden">
|
2023-03-17 05:10:38 +00:00
|
|
|
<button
|
2023-01-31 13:54:45 +00:00
|
|
|
type="button"
|
2023-07-17 10:58:23 +00:00
|
|
|
className="grid h-8 w-8 place-items-center rounded border border-custom-border-200"
|
2023-01-31 13:54:45 +00:00
|
|
|
onClick={() => setToggleSidebar((prevData) => !prevData)}
|
|
|
|
>
|
|
|
|
<Bars3Icon className="h-5 w-5" />
|
2023-03-17 05:10:38 +00:00
|
|
|
</button>
|
2023-01-26 18:12:20 +00:00
|
|
|
</div>
|
2023-01-31 13:54:45 +00:00
|
|
|
{breadcrumbs}
|
2023-07-31 11:52:48 +00:00
|
|
|
<div className="flex-shrink-0">{left}</div>
|
2023-01-31 13:54:45 +00:00
|
|
|
</div>
|
2023-07-31 11:52:48 +00:00
|
|
|
<div className="flex-shrink-0">{right}</div>
|
2023-01-31 13:54:45 +00:00
|
|
|
</div>
|
|
|
|
);
|
2023-01-26 18:12:20 +00:00
|
|
|
|
|
|
|
export default Header;
|