Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
feat: improved duration component
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jan 20, 2022
1 parent 8c548eb commit b4042f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/peeky-client/src/features/Duration.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { computed, PropType } from 'vue'
import { formatDuration } from '@peeky/utils/dist/format'
const props = defineProps({
duration: {
type: Number,
type: Number as PropType<number | null>,
default: null,
},
Expand All @@ -24,13 +24,13 @@ const props = defineProps({
},
})
const formatted = computed(() => formatDuration(props.duration))
const formatted = computed(() => formatDuration(props.duration ?? 0))
</script>

<template>
<span
v-if="duration != null"
class="text-black dark:text-white opacity-40"
class="text-black dark:text-white opacity-40 text-xs mt-1"
:class="{
'!text-yellow-500': !noColors && duration > big && duration <= huge,
'!text-orange-500': !noColors && duration > huge,
Expand Down

0 comments on commit b4042f0

Please sign in to comment.