front-hub/src/components/ComplexHeader.tsx

32 lines
699 B
TypeScript
Raw Normal View History

2023-11-05 23:33:40 +00:00
import { SxProps, Theme, Typography, useTheme } from "@mui/material"
2022-12-04 12:41:10 +00:00
interface Props {
text1: string;
text2?: string;
sx?: SxProps<Theme>;
}
export default function ComplexHeader({ text1, text2, sx }: Props) {
2023-11-05 23:33:40 +00:00
const theme = useTheme()
2022-12-04 12:41:10 +00:00
2023-11-05 23:33:40 +00:00
return (
<Typography variant="h4" sx={sx}>
{text1}
{text2 &&
2022-12-04 12:41:10 +00:00
<Typography
2023-11-05 23:33:40 +00:00
component="span"
sx={{
fontWeight: "inherit",
fontSize: "inherit",
lineHeight: "inherit",
color: theme.palette.purple.main,
}}
2022-12-04 12:41:10 +00:00
>
2023-11-05 23:33:40 +00:00
{text2}
2022-12-04 12:41:10 +00:00
</Typography>
2023-11-05 23:33:40 +00:00
}
</Typography>
)
2023-08-22 10:28:22 +00:00
}