<template>
  <div :style="styleMap?.mainStyle" class="w-full h-full box-border relative">
    <ImageBg
      v-if="styleMap?.mainStyle?.imageSrc"
      :src="styleMap?.mainStyle?.imageSrc"
      :imageStyle="styleMap?.mainStyle?.imageStyle"
    />
  </div>
</template>

<script setup lang="ts">
import { useWidgetStyle } from '../hooks/useWidgetStyle'
import ImageBg from '../ImageBg.vue'

const props = defineProps<{
  width: number
  height: number
  styles: any
  state: string
  part: string
  openRotate?: boolean
  rotate?: {
    x: number
    y: number
    angle: number
  }
}>()

const styleMap = useWidgetStyle({
  widget: 'lv_obj',
  props
})
</script>

<style scoped></style>
