<template>
  <span v-if="b||m">
    {{description}}
    <suspense>
      <pair-price :base="base" :quote="quote" :value="price" :show-btn="showBtn"/>
    </suspense>
  </span>
</template>

<script setup>

import PairPrice from "@/components/PairPrice.vue";
import {computed} from "vue";
import {useStore} from "@/store/store.js";

const props = defineProps(['base', 'quote', 'm', 'b', 'isMin', 'showBtn', 'buy'])
const s = useStore()


const price = computed(()=>{
  if (props.m === 0)
    return props.b === 0 ? null : props.b
  console.log('raw line price', props.b + props.m * s.clock)
  return props.b + props.m * s.clock
})

const description = computed(()=>{
  if( props.m !== 0 )
    return 'diagonal'
  return props.isMin ? 'limit' : 'dont-chase'
})


</script>

<style scoped lang="scss">

</style>