44 lines
979 B
TypeScript
44 lines
979 B
TypeScript
![]() |
import { Box, useTheme } from "@mui/material";
|
||
|
|
||
|
type CheckboxIconProps = {
|
||
|
checked?: boolean;
|
||
|
};
|
||
|
|
||
|
export const CheckboxIcon = ({ checked = false }: CheckboxIconProps) => {
|
||
|
const theme = useTheme();
|
||
|
|
||
|
return (
|
||
|
<Box
|
||
|
sx={{
|
||
|
height: "24px",
|
||
|
width: "24px",
|
||
|
borderRadius: "6px",
|
||
|
display: "flex",
|
||
|
justifyContent: "center",
|
||
|
alignItems: "center",
|
||
|
backgroundColor: checked
|
||
|
? theme.palette.brightPurple.main
|
||
|
: theme.palette.background.default,
|
||
|
border: `1px solid ${theme.palette.grey2.main}`,
|
||
|
}}
|
||
|
>
|
||
|
{checked && (
|
||
|
<svg
|
||
|
xmlns="http://www.w3.org/2000/svg"
|
||
|
width="15"
|
||
|
height="15"
|
||
|
viewBox="0 0 25 18"
|
||
|
fill="none"
|
||
|
>
|
||
|
<path
|
||
|
d="M2 9L10 16.5L22.5 1.5"
|
||
|
stroke="#ffffff"
|
||
|
strokeWidth="4"
|
||
|
strokeLinecap="round"
|
||
|
/>
|
||
|
</svg>
|
||
|
)}
|
||
|
</Box>
|
||
|
);
|
||
|
};
|