UIKit/lib/components/CloseButton.tsx
2023-08-21 14:10:34 +03:00

35 lines
945 B
TypeScript

import { IconButton, IconButtonProps, SxProps, Theme, useTheme } from "@mui/material";
interface Props {
onClick?: IconButtonProps["onClick"];
sx?: SxProps<Theme>;
}
export function CloseButton({ onClick, sx }: Props) {
const theme = useTheme();
return (
<IconButton
onClick={onClick}
sx={{
height: 30,
width: 30,
p: 0,
color: "black",
"&:hover": {
color: theme.palette.orange.main,
},
"&:active": {
color: theme.palette.orange.main,
},
...sx,
}}
>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 30 31" fill="none">
<path d="m3 3.605 24 24m-24 0 24-24" stroke="currentColor" />
</svg>
</IconButton>
);
}