profit-pill -> script setup

This commit is contained in:
Matthias 2023-02-28 20:43:10 +01:00
parent 9aecdc9bbf
commit 988615075c

View File

@ -19,23 +19,19 @@
</div>
</template>
<script lang="ts">
<script setup lang="ts">
import { formatPercent, formatPrice } from '@/shared/formatters';
import ProfitSymbol from '@/components/general/ProfitSymbol.vue';
import { defineComponent, computed } from 'vue';
import { computed } from 'vue';
export default defineComponent({
name: 'ProfitPill',
components: { ProfitSymbol },
props: {
const props = defineProps({
profitRatio: { required: false, default: undefined, type: Number },
profitAbs: { required: false, default: undefined, type: Number },
stakeCurrency: { required: true, type: String },
profitDesc: { required: false, default: '', type: String },
},
setup(props) {
});
const isProfitable = computed(() => {
return (
(props.profitRatio !== undefined && props.profitRatio > 0) ||
@ -51,9 +47,6 @@ export default defineComponent({
}
return '';
});
return { profitString, isProfitable, formatPercent };
},
});
</script>
<style scoped lang="scss">