Files
SolarEnergy/central_frontend/src/widgets/SolarEnergyRouteContainer.tsx
2024-10-03 20:52:05 +02:00

36 lines
774 B
TypeScript

import { Typography } from "@mui/material";
import React, { PropsWithChildren } from "react";
export function SolarEnergyRouteContainer(
p: {
label: string;
homeWidget?: boolean;
actions?: React.ReactElement;
} & PropsWithChildren
): React.ReactElement {
return (
<div
style={{
margin: p.homeWidget ? "0px" : "50px",
flex: 1,
maxWidth: "1300px",
}}
>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
marginBottom: "20px",
flex: 1,
}}
>
<Typography variant={p.homeWidget ? "h6" : "h4"}>{p.label}</Typography>
{p.actions ?? <></>}
</div>
{p.children}
</div>
);
}