frontAnswerer/lib/assets/icons/Checkbox.tsx

32 lines
810 B
TypeScript
Raw Normal View History

2023-12-16 14:55:56 +00:00
import { Box, useTheme } from "@mui/material";
type CheckboxIconProps = {
checked?: boolean;
2023-12-29 00:58:19 +00:00
color?: string;
2023-12-16 14:55:56 +00:00
};
2024-05-31 16:41:18 +00:00
export const CheckboxIcon = ({ checked = false, color = "#7E2AEA" }: CheckboxIconProps) => {
2023-12-16 14:55:56 +00:00
const theme = useTheme();
return (
<Box
sx={{
height: "24px",
width: "24px",
borderRadius: "6px",
display: "flex",
justifyContent: "center",
alignItems: "center",
2024-05-31 16:41:18 +00:00
backgroundColor: checked ? color : "#F2F3F7",
2023-12-29 00:58:19 +00:00
border: `1px solid #9A9AAF`,
2023-12-16 14:55:56 +00:00
}}
>
{checked && (
2024-05-31 16:41:18 +00:00
<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" />
2023-12-16 14:55:56 +00:00
</svg>
)}
</Box>
);
};