frontAnswerer/lib/assets/icons/Checkbox.tsx

45 lines
948 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
};
2023-12-29 00:58:19 +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",
backgroundColor: checked
2023-12-29 00:58:19 +00:00
? color
: "#F2F3F7",
border: `1px solid #9A9AAF`,
2023-12-16 14:55:56 +00:00
}}
>
{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>
);
};