skyouc
5 天以前 27f59f44345d044967e2048f09dbd704f90ce3db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { IconButton } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
 
const DialogCloseButton = (props) => {
    const {
        onClose,
        top = 8,
        right = 8,
        color,
    } = props;
 
    return (
        <>
            <IconButton
                aria-label="close"
                onClick={onClose}
                sx={{
                    position: 'absolute',
                    right,
                    top,
                    color: theme => (color ? color : theme.palette.grey[500]),
                }}
            >
                <CloseIcon />
            </IconButton>
        </>
    );
};
 
export default DialogCloseButton;