fix: project detail - phase and date

This commit is contained in:
DomWane 2024-10-10 11:59:30 +02:00
parent 8b5d67276f
commit 1a958bf168

View file

@ -4,8 +4,6 @@ import type { Project } from '~/types'
defineProps<{ defineProps<{
project: Project project: Project
}>() }>()
const { projectPhase } = storeToRefs(useData())
</script> </script>
<template> <template>
@ -62,12 +60,12 @@ const { projectPhase } = storeToRefs(useData())
h-10px h-10px
w-10px w-10px
rounded-full rounded-full
:class=" project.project_phase ? 'bg-green' : 'bg-red'" :class=" project.project_status?.version ? 'bg-green' : 'bg-red'"
/><p /><p
:class="project.project_phase ? 'text-white' : 'text-app-text-grey'" :class="project.project_status?.version ? 'text-white' : 'text-app-text-grey'"
leading="20px lg:24px" leading="20px lg:24px"
> >
{{ projectPhase.find(p => p.id === project.project_phase)?.name || 'N/A' }} {{ project.project_status?.version ? `${project.project_status?.version?.charAt(0).toUpperCase()}${project.project_status?.version?.slice(1)}` : 'N/A' }}
</p> </p>
</div> </div>
</div> </div>
@ -113,7 +111,7 @@ const { projectPhase } = storeToRefs(useData())
leading="20px lg:24px" leading="20px lg:24px"
:class=" project.product_launch_day ? '' : 'opacity-50'" :class=" project.product_launch_day ? '' : 'opacity-50'"
> >
{{ project.product_launch_day || 'N/A' }} {{ project.product_launch_day ? new Intl.DateTimeFormat('en-UK').format(new Date(project.product_launch_day)) : 'N/A' }}
</p> </p>
</div> </div>
</div> </div>