You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
978 B
TypeScript
42 lines
978 B
TypeScript
1 year ago
|
import "./ToolIcon.scss";
|
||
1 year ago
|
|
||
|
import clsx from "clsx";
|
||
1 year ago
|
import { ToolButtonSize } from "./ToolButton";
|
||
|
import { laserPointerToolIcon } from "./icons";
|
||
1 year ago
|
|
||
|
type LaserPointerIconProps = {
|
||
|
title?: string;
|
||
|
name?: string;
|
||
|
checked: boolean;
|
||
|
onChange?(): void;
|
||
|
isMobile?: boolean;
|
||
|
};
|
||
|
|
||
|
const DEFAULT_SIZE: ToolButtonSize = "small";
|
||
|
|
||
|
export const LaserPointerButton = (props: LaserPointerIconProps) => {
|
||
|
return (
|
||
|
<label
|
||
|
className={clsx(
|
||
|
"ToolIcon ToolIcon__LaserPointer",
|
||
|
`ToolIcon_size_${DEFAULT_SIZE}`,
|
||
|
{
|
||
|
"is-mobile": props.isMobile,
|
||
|
},
|
||
|
)}
|
||
|
title={`${props.title}`}
|
||
|
>
|
||
|
<input
|
||
|
className="ToolIcon_type_checkbox"
|
||
|
type="checkbox"
|
||
|
name={props.name}
|
||
|
onChange={props.onChange}
|
||
|
checked={props.checked}
|
||
|
aria-label={props.title}
|
||
|
data-testid="toolbar-LaserPointer"
|
||
|
/>
|
||
|
<div className="ToolIcon__icon">{laserPointerToolIcon}</div>
|
||
|
</label>
|
||
|
);
|
||
|
};
|