<script setup lang="ts">
import MENU_IMAGE from "/assets/images/settings/top-screen/touch_screen/touch-screen.webp";
import MENU_DISABLED_IMAGE from "/assets/images/settings/top-screen/touch_screen/touch-screen-disabled.png";

const props = defineProps<{
  x: number;
  y: number;
  isAnyOtherMenuOpen: boolean;
}>();

const [menuImage, menuDisabledImage] = useImages(
  MENU_IMAGE,
  MENU_DISABLED_IMAGE,
);

useRender((ctx) => {
  if (props.isAnyOtherMenuOpen) {
    ctx.drawImage(menuDisabledImage!, props.x, props.y);
  } else {
    ctx.drawImage(menuImage!, props.x, props.y);
  }
});

defineOptions({
  render: () => null,
});
</script>
