mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2025-12-18 04:59:23 +00:00
19 lines
554 B
TypeScript
19 lines
554 B
TypeScript
import { Box, Stack, StackProps, Typography } from "@mui/material";
|
|
import { memo, PropsWithChildren } from "react";
|
|
|
|
export type Props = PropsWithChildren<{ title: string } & StackProps>;
|
|
|
|
const StyledComponent = ({ children, title, ...stackProps }: Props) => (
|
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
<Stack {...stackProps}>
|
|
<Typography variant="h6" component="h2">
|
|
{title}
|
|
</Typography>
|
|
<Box flexGrow={1}>{children}</Box>
|
|
</Stack>
|
|
);
|
|
|
|
export const Component = memo(StyledComponent);
|
|
|
|
export default Component;
|