link-stack/packages/leafcutter-common/components/PageHeader.tsx

41 lines
757 B
TypeScript
Raw Normal View History

2023-06-26 10:07:12 +00:00
"use client";
2023-02-13 13:46:56 +00:00
/* eslint-disable react/require-default-props */
2023-05-24 20:27:57 +00:00
import { FC, PropsWithChildren } from "react";
2023-02-13 13:46:56 +00:00
import { Box } from "@mui/material";
2023-08-25 10:04:48 +02:00
import { useAppContext } from "./AppProvider";
2023-02-13 13:46:56 +00:00
2023-05-24 20:27:57 +00:00
type PageHeaderProps = PropsWithChildren<{
2023-02-13 13:46:56 +00:00
backgroundColor: string;
sx?: any;
2023-05-24 20:27:57 +00:00
}>;
2023-02-13 13:46:56 +00:00
export const PageHeader: FC<PageHeaderProps> = ({
backgroundColor,
sx = {},
children,
2023-03-22 07:50:47 +00:00
}: any) => {
2023-02-13 13:46:56 +00:00
const {
colors: { white },
} = useAppContext();
return (
<Box
sx={{
width: "100%",
backgroundColor,
color: white,
p: 3,
borderRadius: "10px",
mb: "22px",
minHeight: "100px",
zIndex: 1000,
position: "relative",
...sx,
}}
>
{children}
</Box>
);
};