import { FC } from "react"; import styled from "styled-components"; import { GLYPHS, StyledIcon } from "../../Icon"; import { CheckboxIconProps } from "../types"; const StyledCheckboxIcon = styled(StyledIcon).attrs({ styledWidth: "1em" })<{ disabled?: boolean; isSwitch?: boolean }>` top: 0.125em; align-self: flex-start; position: relative; fill: currentColor; ${(props) => !props.disabled && ` &:hover { opacity: 0.6; } `} ${(props) => props.isSwitch && ` width: 28px; &:hover { opacity: 0.95; } `} `; const CheckboxIcon: FC = (props: CheckboxIconProps) => { const iconOn = props.isSwitch ? GLYPHS.switchOn : GLYPHS.checkboxOn; const iconOff = props.isSwitch ? GLYPHS.switchOff : GLYPHS.checkboxOff; if (props.isDisabled) { return ( ); } else { return ( ); } }; export default CheckboxIcon;