<script setup lang="ts">
import {useConfigStore} from "@/store";

const props = withDefaults(defineProps<{
  text: string,
  fixed?: boolean
}>(), {
  fixed: false
})

const emit = defineEmits<{
  click: [event: any]
}>()

const configStore = useConfigStore()

function handleClick(event: any) {
  emit('click', event)
}
</script>

<template>
  <view class="">
    <view class="h-128rpx" :style="[configStore.iosSafeBottomPlaceholder]" v-if="props.fixed"></view>
    <view class="z-1 bg-#fff shadow-[0rpx_-6rpx_24rpx_rgba(0,0,0,0.16)]" :style="[props.fixed&&{
      position: 'fixed',
      bottom: '0',
      left: '0',
      right: '0',
    }]">
      <view class="h-128rpx p-[16rpx+30rpx] box-border">
        <wd-button custom-class="!h-92rpx !text-30rpx !lh-42rpx !rounded-20rpx !bg-#14181B" block
                   @click="handleClick">
          {{ props.text }}
        </wd-button>
      </view>
      <view :style="[configStore.iosSafeBottomPlaceholder]"></view>
    </view>
  </view>
</template>

<style scoped lang="scss">

</style>
