import { FC } from "@tarojs/taro";
import { MouseEventHandler } from "react";

export interface CanvasAdapterProps {
  onTouchStart: MouseEventHandler<HTMLCanvasElement>;
  onTouchEnd: MouseEventHandler<HTMLCanvasElement>;
}

export const CanvasAdapter: FC<CanvasAdapterProps> = ({
  onTouchEnd,
  onTouchStart,
}) => {
  return <canvas id="wgl" onMouseDown={onTouchStart} onMouseUp={onTouchEnd} />;
};
