<template>
  <WlPopup
    v-model="tip_visible"
    round
    position="bottom"
    :overlay="false"
    :style="tipPopStyle"
    @click="onClick"
  >
    <div class="wrapper">
      <div class="text">以上结果没有我想要的企业，直接创建：</div>
      <div class="company-name">{{ company_name }}</div>
    </div>
  </WlPopup>
</template>

<script lang="ts">
export default {
  name: "Tip",
};
</script>

<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import WlPopup from "@mobileUI/components/WlPopup/src/index.vue";

const tip_visible = ref();
interface Props {
  modelValue: boolean;
  company_name: string;
}
const props = withDefaults(defineProps<Props>(), {
  modelValue: false,
  company_name: "",
});
const emit = defineEmits<{
  (e: "close_tip_visible", val: boolean);
}>();
const onClick = () => {
  tip_visible.value = false;
  emit("close_tip_visible", tip_visible.value);
};
watchEffect(() => {
  tip_visible.value = props.modelValue;
});
const tipPopStyle = computed(() => {
  return {
    height: "15%",
    boxShadow: "0px 0px 4px 6px #eee",
    overflow: "initial",
    boxSizing: "border-box",
  };
});
</script>

<style lang="scss" scoped>
.wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  .text {
    text-align: center;
  }
  .company-name {
    text-align: center;
    // margin-top: j(5);
    color: rgb(29, 154, 251);
  }
}
</style>
