i18n: ProjectListView traducido
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted } from "vue"
|
import { onMounted } from "vue"
|
||||||
|
import { useI18n } from "vue-i18n"
|
||||||
import { useProjectsStore } from "@/stores/projects"
|
import { useProjectsStore } from "@/stores/projects"
|
||||||
import { IconFolder, IconExclamationCircle } from "@tabler/icons-vue"
|
import { IconFolder, IconExclamationCircle } from "@tabler/icons-vue"
|
||||||
import {
|
import {
|
||||||
@@ -11,6 +12,7 @@ import {
|
|||||||
import { Badge } from "@/components/ui/badge"
|
import { Badge } from "@/components/ui/badge"
|
||||||
import { Skeleton } from "@/components/ui/skeleton"
|
import { Skeleton } from "@/components/ui/skeleton"
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
const projects = useProjectsStore()
|
const projects = useProjectsStore()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -35,13 +37,13 @@ function getStatusVariant(status?: string) {
|
|||||||
<div class="flex flex-col gap-6 px-4 lg:px-6">
|
<div class="flex flex-col gap-6 px-4 lg:px-6">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h2 class="text-2xl font-bold tracking-tight">Proyectos</h2>
|
<h2 class="text-2xl font-bold tracking-tight">{{ t('projects.title') }}</h2>
|
||||||
<p class="text-muted-foreground">
|
<p class="text-muted-foreground">
|
||||||
Proyectos asignados en KAPPA
|
{{ t('projects.subtitle') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Badge variant="outline" class="text-sm">
|
<Badge variant="outline" class="text-sm">
|
||||||
{{ projects.count }} proyecto{{ projects.count !== 1 ? 's' : '' }}
|
{{ t('projects.countLabel', { count: projects.count }) }}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -58,22 +60,22 @@ function getStatusVariant(status?: string) {
|
|||||||
<!-- Error -->
|
<!-- Error -->
|
||||||
<div v-else-if="projects.error" class="flex flex-col items-center gap-3 py-12 text-center">
|
<div v-else-if="projects.error" class="flex flex-col items-center gap-3 py-12 text-center">
|
||||||
<IconExclamationCircle class="size-10 text-destructive" />
|
<IconExclamationCircle class="size-10 text-destructive" />
|
||||||
<p class="text-lg font-medium">Error al cargar proyectos</p>
|
<p class="text-lg font-medium">{{ t('projects.loadError') }}</p>
|
||||||
<p class="text-sm text-muted-foreground">{{ projects.error }}</p>
|
<p class="text-sm text-muted-foreground">{{ projects.error }}</p>
|
||||||
<button
|
<button
|
||||||
class="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
|
class="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
|
||||||
@click="projects.fetchProjects()"
|
@click="projects.fetchProjects()"
|
||||||
>
|
>
|
||||||
Reintentar
|
{{ t('common.retry') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Empty -->
|
<!-- Empty -->
|
||||||
<div v-else-if="projects.count === 0" class="flex flex-col items-center gap-3 py-12 text-center">
|
<div v-else-if="projects.count === 0" class="flex flex-col items-center gap-3 py-12 text-center">
|
||||||
<IconFolder class="size-10 text-muted-foreground" />
|
<IconFolder class="size-10 text-muted-foreground" />
|
||||||
<p class="text-lg font-medium">Sin proyectos asignados</p>
|
<p class="text-lg font-medium">{{ t('projects.emptyTitle') }}</p>
|
||||||
<p class="text-sm text-muted-foreground">
|
<p class="text-sm text-muted-foreground">
|
||||||
No tienes proyectos activos en KAPPA.
|
{{ t('projects.emptyDescription') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -91,14 +93,14 @@ function getStatusVariant(status?: string) {
|
|||||||
<CardHeader>
|
<CardHeader>
|
||||||
<div class="flex items-start justify-between gap-2">
|
<div class="flex items-start justify-between gap-2">
|
||||||
<CardTitle class="text-base">
|
<CardTitle class="text-base">
|
||||||
{{ p.initiative_name || p.name || `Proyecto ${p.id}` }}
|
{{ p.initiative_name || p.name || t('projects.unnamedFallback', { id: p.id }) }}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<Badge :variant="getStatusVariant(p.status)">
|
<Badge :variant="getStatusVariant(p.status)">
|
||||||
{{ p.status || 'active' }}
|
{{ p.status || 'active' }}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
<CardDescription class="line-clamp-2">
|
<CardDescription class="line-clamp-2">
|
||||||
{{ p.description || 'Sin descripción' }}
|
{{ p.description || t('projects.noDescription') }}
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
<div v-if="p.key" class="flex items-center gap-2 pt-1">
|
<div v-if="p.key" class="flex items-center gap-2 pt-1">
|
||||||
<Badge variant="secondary" class="font-mono text-xs">
|
<Badge variant="secondary" class="font-mono text-xs">
|
||||||
|
|||||||
Reference in New Issue
Block a user