mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
use Memo for caching
This commit is contained in:
@@ -1,26 +1,24 @@
|
|||||||
import type { FC } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
import { Box } from '@mui/material';
|
import { Box } from '@mui/material';
|
||||||
import type { BoxProps } from '@mui/material';
|
import type { BoxProps } from '@mui/material';
|
||||||
|
|
||||||
const ButtonRow: FC<BoxProps> = ({ children, ...rest }) => (
|
const ButtonRow = memo<BoxProps>(({ children, ...rest }) => (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
'& button, & a, & .MuiCard-root': {
|
'& button, & a, & .MuiCard-root': {
|
||||||
mt: 2,
|
mt: 2,
|
||||||
mx: 0.6,
|
mx: 0.6,
|
||||||
'&:last-child': {
|
'&:last-child': { mr: 0 },
|
||||||
mr: 0
|
'&:first-of-type': { ml: 0 }
|
||||||
},
|
|
||||||
'&:first-of-type': {
|
|
||||||
ml: 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
));
|
||||||
|
|
||||||
|
ButtonRow.displayName = 'ButtonRow';
|
||||||
|
|
||||||
export default ButtonRow;
|
export default ButtonRow;
|
||||||
|
|||||||
Reference in New Issue
Block a user