import { Canvas, CanvasTouchEventFunction } from "@tarojs/components";
import { FC } from "@tarojs/taro";

export interface CanvasAdapterProps {
  onTouchStart: CanvasTouchEventFunction;
  onTouchEnd: CanvasTouchEventFunction;
}

export const CanvasAdapter: FC<CanvasAdapterProps> = ({
  onTouchEnd,
  onTouchStart,
}) => {
  return (
    <Canvas
      id="wgl"
      type="webgl"
      onTouchStart={onTouchStart}
      onTouchEnd={onTouchEnd}
    />
  );
};
