2020-09-02 18:53:59 +00:00
|
|
|
<template>
|
2020-09-03 04:49:10 +00:00
|
|
|
<div class="h-100 d-inline-block">
|
|
|
|
<div :class="isProfitable ? 'triangle-up' : 'triangle-down'"></div>
|
|
|
|
</div>
|
2020-09-02 18:53:59 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-09-04 08:35:44 +00:00
|
|
|
// TODO: evaluate if this is still used
|
2020-09-02 18:53:59 +00:00
|
|
|
import { Component, Vue, Prop } from 'vue-property-decorator';
|
|
|
|
import { Trade } from '@/types';
|
|
|
|
|
|
|
|
@Component({})
|
|
|
|
export default class ProfitSymbol extends Vue {
|
|
|
|
@Prop({ required: true }) trade!: Trade;
|
|
|
|
|
|
|
|
get isProfitable() {
|
2020-12-05 14:55:26 +00:00
|
|
|
const res = (this.trade.profit_ratio ?? 0) > 0 || (this.trade.profit_abs ?? 0) > 0;
|
2020-09-02 18:53:59 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2020-09-03 04:49:10 +00:00
|
|
|
<style scoped>
|
|
|
|
.triangle-up {
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
border-style: solid;
|
2020-09-04 15:04:09 +00:00
|
|
|
border-width: 0 0.45rem 0.7rem 0.45rem;
|
2020-09-03 04:49:10 +00:00
|
|
|
border-color: transparent transparent #00db58 transparent;
|
|
|
|
}
|
|
|
|
.triangle-down {
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
border-style: solid;
|
2020-09-04 15:04:09 +00:00
|
|
|
border-width: 0.7rem 0.45rem 0 0.45rem;
|
2020-09-03 04:49:10 +00:00
|
|
|
border-color: #ff0000 transparent transparent transparent;
|
|
|
|
}
|
|
|
|
</style>
|