<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(()=>props.m === 0 ? props.b : props.b + props.m * s.clock)

const description = computed(()=>{
  // console.log('tranche line', isMin, b, m)
  if( props.m !== 0 )
    return 'diagonal'
  return props.isMin === props.buy ? 'dont-chase' : 'limit'
})


</script>

<style scoped lang="scss">

</style>