Add goals feature for personal goals with filters

This commit is contained in:
Gregor Vostrak
2026-10-02 12:59:44 +02:00
parent 5010a5be3a
commit 63ca886154
83 changed files with 7702 additions and 105 deletions

View File

@@ -0,0 +1,41 @@
<script setup lang="ts">
import { computed } from 'vue';
import { CheckCircleIcon, ExclamationCircleIcon, ClockIcon } from '@heroicons/vue/20/solid';
import type { GoalStatus } from '@/packages/api/src';
import { goalStatusIsPositive, goalStatusLabel } from '@/utils/goals';
const props = defineProps<{
status: GoalStatus;
}>();
const icon = computed(() => {
if (props.status === 'exceeded') {
return ExclamationCircleIcon;
}
if (props.status === 'achieved') {
return CheckCircleIcon;
}
return ClockIcon;
});
const colorClass = computed(() => {
if (props.status === 'exceeded') {
return 'text-red-500';
}
if (goalStatusIsPositive(props.status)) {
return 'text-green-500';
}
return 'text-icon-default';
});
</script>
<template>
<span
class="inline-flex items-center space-x-1.5 text-sm text-text-primary"
:data-status="status">
<component :is="icon" class="w-4" :class="colorClass"></component>
<span>{{ goalStatusLabel(status) }}</span>
</span>
</template>
<style scoped></style>